Remove the NaN elements in a matrix
이전 댓글 표시
Hi everybody, I have a problem with removing the NaN elements in a matrix, Suppose we have a matrix A of size M, N and there are some NaN elements. So I want to remove all the rows that contain NaN elements.
I wrote some commands but they do not work. Could you please check it for me?
[m n]=size(A);
for i2=m:-1:1
for i3= 1:n
if (isnan(A))
A(i2,:)=[];
end
end
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!