Length of elements in array that are not NaN
60 views (last 30 days)
Show older comments
Commented: Benjamin on 12 Nov 2018
I am trying to get the length of an array, and exclude NaN values. At the end of the column there are some NaNs. How can I ignore those?
But this includes the Nans
When I try:
Error: Invalid use of operator.
Matt J on 12 Nov 2018
Edited: Matt J on 12 Nov 2018
num_no_nans = sum( ~isnan(thisS(:,11)) )
More Answers (0)
Find more on NaNs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!