Replacing null value with NaN

조회 수: 5 (최근 30일)
Sara
Sara 2013년 7월 5일
Hi
I have built a 4D cell (called B), and some of the matrixes included on it ( [11x6 single]) have null values (1e20) which I want to get rid of.
First I've tried this inside of my for cycle, where a and m are iterating:
B(B{1,1,a,m}>1e19) = NaN;
and, Matlab "complained" saying that "Conversion to cell from double is not possible."
Then I tried this: B(B>1e19) = NaN, and Matlab once again pointed out error saying "Undefined function 'eq' for input arguments of type 'cell'.".
Could anyone explain me, how can I replace null values by NaN, in a 4-D cell? I'de be VERY thankfull for help!
Sara

채택된 답변

Matt J
Matt J 2013년 7월 5일
B{1,1,a,m}(B{1,1,a,m}>1e19) = NaN;
  댓글 수: 2
Sara
Sara 2013년 7월 5일
Oh thanks a lot Matt! Kindest regards. Sara
Matt J
Matt J 2013년 7월 5일
편집: Matt J 2013년 7월 5일
No problem. Because you are new to this site, I'll just mention that you would normally click "Accept" on answers that resolve your issue.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by