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

조회 수: 19 (최근 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 CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by