How to count data in a struct?
显示 更早的评论
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 个评论
per isakson
2019-4-26
编辑:per isakson
2019-4-26
See the functions
and try
sum(double( isnan( [centers.lat] )))
Proposal: Upload a small sample of the data
Marco Barron
2019-4-26
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!