Replacing Values of one matrix with another

1 回表示 (過去 30 日間)
Kayla Washington
Kayla Washington 2021 年 11 月 5 日
コメント済み: Kayla Washington 2021 年 11 月 5 日
I'm trying to replace one Matrix values with NaNs from another vector in the same locations, but I keep getting getting the reverse. It puts NaNs where values are supposed and keeps the values where NaNs are supposed to show. My code is:
isn_east = find(~isnan(east));
VV=Reference_E;
>> VV(isn_east)=NaN;
east is the matrix where the NaNs are located. VV is matrix the i'm tryig to put NaNs in.

採用された回答

Stephen23
Stephen23 2021 年 11 月 5 日
編集済み: Stephen23 2021 年 11 月 5 日
isn_east = isnan(east);
or simply:
VV = Reference_E;
VV(isnan(east)) = NaN;

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by