How to perform the following commands?
2 ビュー (過去 30 日間)
古いコメントを表示
How to perform the following commands:
result1 = m(:,abs(m(2,:))< threshold ); .......... This line I want to exclude zero value also.(I mean if it zero ignore it and look at the next value)
[~,idx] = min(abs(result1(1,:))); ....... This line I want to exclude zero value also. (I mean if it zero ignore it and look at the next value)
3 件のコメント
Walter Roberson
2022 年 5 月 24 日
create a temporary vector that is abs() and replace 0 values with nan and min() that.
Or loop.
採用された回答
Walter Roberson
2022 年 5 月 24 日
temp = abs(result1(1,:));
temp(temp==0) = nan;
[~, idx] = min(temp) ;
0 件のコメント
その他の回答 (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!