필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Anitha Limann
Anitha Limann 2022년 10월 23일
댓글: Anitha Limann 2022년 10월 23일
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
dpb
dpb 2022년 10월 23일
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...
Anitha Limann
Anitha Limann 2022년 10월 23일
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).

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by