deleting nan rows in a matrix
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
is there a simple method to delete the rows in which there is a nan in a matrix? I wrote the codes this way: [x1,y1]=find(isnan(AR1)); x1b=unique(x1); AR1(x1b,:)=[];
but I feel that I can delete these rows in a simpler way.
0 件のコメント
採用された回答
その他の回答 (1 件)
Image Analyst
2012 年 3 月 4 日
I think most people would use any. Here's a way but it's not necessarily much faster or better than your way:
AR1(any(isnan(AR1), 2),:)=[]
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で NaNs についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!