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

17 Ansichten (letzte 30 Tage)
Zeynab Mousavikhamene
Zeynab Mousavikhamene am 8 Okt. 2019
Beantwortet: the cyclist am 8 Okt. 2019
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 Kommentare
Rik
Rik am 8 Okt. 2019
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 am 8 Okt. 2019
Bearbeitet: Zeynab Mousavikhamene am 8 Okt. 2019
@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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by