How to check if cell has particular value or not?

조회 수: 24 (최근 30일)
raghavendra kandukuri
raghavendra kandukuri 2019년 5월 22일
편집: madhan ravi 2019년 5월 22일
Hi,
I have variable named 'result1' which is basically 1*2 cell and i want to write condition saying.
Thanks in Advance
if result1="NaN" % either in index1 or index2
% do this cal
else
% do this cal
end

채택된 답변

madhan ravi
madhan ravi 2019년 5월 22일
contains() - if it contains "NaN" a string
isnan() - if it contains NaN value
  댓글 수: 2
raghavendra kandukuri
raghavendra kandukuri 2019년 5월 22일
Undefined function 'isnan' for input arguments of type 'cell'.
madhan ravi
madhan ravi 2019년 5월 22일
편집: madhan ravi 2019년 5월 22일
cellfun(@isnan,yourcell,'un',0)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by