How to count data in a struct?
Ältere Kommentare anzeigen
I have a struct with 61,460 lines of data that span a time period of nearly 7 years. I'm plotting a range of that data from say 4314 to 5600 using a
for i = 4314:5600,
plot(centers(i).lon, centers(i).lat, 'b*')
end
command. The struct has 6 fields of day, type, lat, lon, j and i. Lat and Lon plot the data with their respective coordinates but in the struct, there are some data sets that don't have any values of Lat or Lon, instead, in the struct, these empty spaces are filled in as "[]" or Not A Number.
Basically, I'm able to plot the range of data I want but I don't know how to count the data that's plotted on the map because between lines 2,000 and 4,000, there aren't 2,000 lines of data. How do I count the number of real data sets between a range of data and exclude non numbers or [] values.
Thanks!
2 Kommentare
per isakson
am 26 Apr. 2019
Bearbeitet: per isakson
am 26 Apr. 2019
See the functions
and try
sum(double( isnan( [centers.lat] )))
Proposal: Upload a small sample of the data
Marco Barron
am 26 Apr. 2019
Antworten (0)
Kategorien
Mehr zu Annotations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!