While all elements are not equal to NaN
조회 수: 14 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
Jos (10584)
2018년 3월 1일
not (~), all, and isnan are your friends. If A is your array,
while ~all(isnan(A(:)))
...
end
댓글 수: 2
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!