I have an array and I turn one element to NaN in each iteration until all elements are NaN, like:
While (all elements in array are not NaN)
do aomething
End
How can I do this?

 채택된 답변

Jos (10584)
Jos (10584) 2018년 3월 1일

4 개 추천

not (~), all, and isnan are your friends. If A is your array,
while ~all(isnan(A(:)))
...
end

댓글 수: 2

evangeline
evangeline 2018년 3월 2일
How can I check if I have a cell array?
Stephen23
Stephen23 2018년 3월 2일
편집: Stephen23 2018년 3월 2일
@Evangeline: iscell, whos, or look at the description in the workspace. How is this related to your question?

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

추가 답변 (1개)

evangeline
evangeline 2018년 3월 2일

0 개 추천

I mean how can I check if all array elements are nan, if my array is an cell array.

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

태그

질문:

2018년 3월 1일

답변:

2018년 3월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by