How to define an area with 1s to use 'areamat' function
2 views (last 30 days)
Show older comments
Hello,
I am planning to use areamat function to calculate total area of african continent. I have set of lat lon data (set of data separated with NaN NaN). As areamat function calculate area of the region defined by 1s or zeros i want to say,
for all the values >=min(lon) and >=min(lat) and <=max(lat) and <=max(lat) are
africa = (those values).
i have not use this function before. So i am not sure if I misunderstood this funstion either.
I would truly appreciate if anyone could help me with this funtion and write a condiction as above.
Thank you!!
2 Comments
dpb
on 23 Oct 2022
The area defined by min(lon) <= valX <= max(lon) and min(lat) <= valY <= max(lat) is a rectangular area that won't represent the actual continent of Africa all that well.
You'll have to have a boundary definition somewhere to ascertain whether a given coordinate pair is/is not within that area -- which would be what having the definition of the input array to areamat would give you if you had it already...but the above logic won't help you generate one, unfortunately.
I don't have mapping TB but there appears to be a dataset included in it -- let's just try something...
load coastlines
hM=worldmap('Africa');
geoshow('landareas.shp', 'FaceColor', [0.15 0.5 0.15])
Well, that gives an outline; there's example code that shows how stuff is broken down inside the coastlines lat, lon data, but I don't know at this point how one determines being in/out of the continent...
Good luck...
Answers (0)
See Also
Categories
Find more on Mapping Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!