How to replace values less than ...

49 ビュー (過去 30 日間)
laith awwad
laith awwad 2021 年 4 月 21 日
コメント済み: laith awwad 2021 年 4 月 24 日
HOW TO NAME THE VARIABLE BECAUSE IF I WRIGHT IT GIVES ME AN ERROR FOR EXAMPLE e =matrix (matrix<=0)= NaN;

採用された回答

DGM
DGM 2021 年 4 月 21 日
Assuming you have a matrix A and you want to make a copy B which has all nonpositive content replaced with NaN
A=randn(100);
B=A; % make a copy
B(B<=0)=NaN; % replace the values
Trying to do something like
B=A(A<=0)=NaN;
isn't going to work.
  1 件のコメント
laith awwad
laith awwad 2021 年 4 月 24 日
Thank you it worked

サインインしてコメントする。

その他の回答 (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