Borrar filtros
Borrar filtros

How to define an area with 1s to use 'areamat' function

2 visualizaciones (últimos 30 días)
Anitha Limann
Anitha Limann el 23 de Oct. de 2022
Comentada: Anitha Limann el 23 de Oct. de 2022
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 comentarios
dpb el 23 de Oct. de 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
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...
Anitha Limann
Anitha Limann el 23 de Oct. de 2022
Hello Thank you for your response.
I do have boundary points along the boundary of the African Continent. I did plot them as below. Now I want to calculate the area defined by these points. My data set is set of points separated by NaN but those sets are unodered.
Could you tell me if you have any method i could use to calculate area?
I tried areaint because these area latitudes and longitueds. But then it calculate only areas defined by each sub-dataset (please see the second image attached here).

Iniciar sesión para comentar.

Respuestas (0)


Más información sobre Geographic Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by