Estimate length with out NaN's
124 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
George
am 11 Mär. 2015
Kommentiert: Star Strider
am 11 Mär. 2015
Hello
I use the length command to see the length of some of my variables, although they include NaN's inside by a previous script I used so as to fill them and compare them Is there a way to find the length of the data non-taking into account the NaN?
I tried nanlength , as you can use nanmean etc. although it does not like it
it gives me this error
Undefined function 'nanlength' for input arguments of type 'double'.
1 Kommentar
Akzeptierte Antwort
Weitere Antworten (1)
Giorgos Papakonstantinou
am 11 Mär. 2015
If x is your vector.
YourLength = length(x) - sum(isnan(x))
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!