Counting the non nan observations in a matrix by row

13 次查看(过去 30 天)
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 中查找有关 NaNs 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by