how do i count NaNs in a vectors or array??
이전 댓글 표시
Sir I have a vector say
A=[5,5,6,NaN,NaN,8,10,5,7,3,NaN,11,5,3,8,9,7,NaN,NaN,NaN,NaN,NaN]
and i want to count the number of NaNs in between the numbers. The result should be[2,1,5]. how can I do it sir? please help
채택된 답변
추가 답변 (1개)
Matt J
2015년 2월 1일
C=SplitVec(isnan(A),'equal',@sum);
result=nonzeros([C{:}]).';
카테고리
도움말 센터 및 File Exchange에서 NaNs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!