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
per isakson 2019년 4월 26일
편집: per isakson 2019년 4월 26일
See the functions
  1. isnan Array elements that are NaN
  2. isempty Determine whether array is empty
and try
sum(double( isnan( [centers.lat] )))
Proposal: Upload a small sample of the data
Marco Barron
Marco Barron 2019년 4월 26일
Wow, thanks, I'll give this a shot over the weekend

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

질문:

2019년 4월 26일

편집:

2019년 4월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by