MATLAB Answers

How can I count the numbers of NaNs in some determined coordinates when you use the comand 'coastlines'?

1 ビュー (過去 30 日間)
Pablo Avendaño Mauriz
Pablo Avendaño Mauriz 2020 年 2 月 11 日
回答済み: Chidvi Modala 2020 年 12 月 30 日
This program gives me the numer of NaNs in all the world but not in one particular country.
worldmap('Spain')
load coastlines
sum(sum(isnan(coastlat)))

回答 (1 件)

Chidvi Modala
Chidvi Modala 2020 年 12 月 30 日
You may use shaperead function to get latitudes and longitudes of a particular country. You can refer to the following example to count the numbers of NaNs in a particular country coordinates
Val = shaperead('landareas', 'UseGeoCoords', true,...
'Selector',{@(name) strcmp(name,'Africa and Eurasia'), 'Name'});
sum(isnan(Val.Lat));

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by