how to count non nan values

Sir in a vector of large dimension say (750,1) which has NaNs as well as some values. I want to count the non nan values. would you please help me

 Accepted Answer

Stephen23
Stephen23 on 22 Jun 2016
Edited: Stephen23 on 22 Jun 2016
nnz(~isnan(vec))
where vec is the vector (it could even be a matrix or ND array).

More Answers (0)

Categories

Asked:

on 22 Jun 2016

Edited:

on 22 Jun 2016

Community Treasure Hunt

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

Start Hunting!