Check all values in a table if any is "NAN"

42 ビュー (過去 30 日間)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 10 月 8 日
回答済み: the cyclist 2019 年 10 月 8 日
I have a table that has multiple column and rows. I want to say if any value in the table was "NAN" then change the value from "NAN" to 1.
Any suggestion?
  2 件のコメント
Rik
Rik 2019 年 10 月 8 日
This is not your first question. What have you tried so far on your own? And are you aware of the isnan function?
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 10 月 8 日
編集済み: Zeynab Mousavikhamene 2019 年 10 月 8 日
@Rik Yeah I know isnan. The problem I have is that I dont want to use for loop to search each element of the table.

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

採用された回答

the cyclist
the cyclist 2019 年 10 月 8 日
This may work for your case
tbl = fillmissing(tbl,'constant',1);
assuming the NaNs are the only values that count as missing for you.

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by