How to replace certain values in matrix ?

1 回表示 (過去 30 日間)
Pritha Pande
Pritha Pande 2017 年 10 月 2 日
コメント済み: Pritha Pande 2017 年 10 月 2 日
I have attached two .jpg files below. In first one i have values and some NaN values, in second file i.e 2_mass, i have matrix all filled with values. I want 2_mass.jpg file to show the NaN values at the same point as seen in 1_mass.jpg file and but other values should remain same. the final output should look like as shown in 3_mass.jpg

採用された回答

Akira Agata
Akira Agata 2017 年 10 月 2 日
Assuming A, B and C are your 1_mass, 2_mass and 3_mass matrix, the solution will be like:
C = B;
idx = isnan(A);
C(idx) = NaN;
  1 件のコメント
Pritha Pande
Pritha Pande 2017 年 10 月 2 日
Thank you.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by