Counting the non nan observations in a matrix by row

조회 수: 3 (최근 30일)
joseph Frank
joseph Frank 2011년 8월 22일
Hi,
I have a matrix for which I want to compute the number of non-nan observations for each row without running a loop. is this possible?

채택된 답변

Oleg Komarov
Oleg Komarov 2011년 8월 22일
sum(~isnan(A),2)

추가 답변 (1개)

Sean de Wolski
Sean de Wolski 2011년 8월 22일
sum(A==A,2);
Variant

카테고리

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