フィルターのクリア

How to perform the following commands?

2 ビュー (過去 30 日間)
M
M 2022 年 5 月 24 日
回答済み: Walter Roberson 2022 年 5 月 24 日
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 件のコメント
M
M 2022 年 5 月 24 日
編集済み: M 2022 年 5 月 24 日
@Walter Roberson, what about the second line" [~,idx] = min(abs(result1(1,:))); "
I want to exclude zero value also from this, I mea take the next abs(min value) after zero?
Walter Roberson
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
Walter Roberson 2022 年 5 月 24 日
temp = abs(result1(1,:));
temp(temp==0) = nan;
[~, idx] = min(temp) ;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNaNs についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by