how to only change the cells with NAN values in a table?

2 ビュー (過去 30 日間)
Salma fathi
Salma fathi 2022 年 7 月 23 日
回答済み: Walter Roberson 2022 年 7 月 23 日
I am trying to apply the following operation on certain rows in a tabel of data
[Lia, Locb] = ismember(datatable2.Date, EDPALL.Date);
indx = Locb(Locb > 0);
datatable2.NE8(Lia) = EDPAll.EDP6(indx);
finding that if any matching dates between some two tables and if satisfied we copy the corresponding value of the variable EDP6 into the variable NE8 in the other table.
But how can we modify this to restric it to happen only to the cells that has NAN values in the variable NE8?

回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 7 月 23 日
[Lia, Locb] = ismember(datatable2.Date, EDPALL.Date);
Lia = Lia & isnan(datatable2.NE8);
indx = Locb(Lia);
datatable2.NE8(Lia) = EDPAll.EDP6(indx);

カテゴリ

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

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by