How do I compute the area enclosed by contourm?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
A LL
am 31 Mai 2021
Kommentiert: Star Strider
am 1 Jun. 2021
Hi all :)
I would like to know how to compute the area enclosed by a contour line plotted using contourm.
I have a 361x361 matrix respectivly for LAT, LON, sicstart. (sicEASE is also 361x361)
sicstart is basicly matrix containing 0, 1 or NaN.
I wanted to use polyarea(x,y) but I am not sure how to use it since I have a matrix of 0 ,1 or NaN and no (x,y) coordinates...
I have attached a figure of the contours I want to compute the area. Here is the code for the blue contour.
%Find ice at start week
sicstart = sicEASE;
index1 = find(sicEASE >= 0.15); %index for ice
index2 = find(sicEASE < 0.15); %index for no ice
sicstart(index1) = 1; %1 for ice
sicstart(index2) = 0; %0 for no ice
figure(1)
ncpolarm('lat',66); hold on;
contourm(LAT,LON,sicstart,'b','LineWidth',1.5);
Thanks for your help
0 Kommentare
Akzeptierte Antwort
Star Strider
am 31 Mai 2021
I do not have the Mapping Toolbox, so I have no experience with contourm. However looking at the documentation, it appears to be the same as for contour, with the ‘C’ matrix in contourm being the same as the ‘M’ matrix in contour. (See the documentation on M for a guide to ite interpretation and to understand how it works.)
Recovering the disjointed contours is not trivial, however it can be done. An example is in how to fill the interior of a closed surface? . There are likely other examples available. This is the first one I found in my archive.
.
4 Kommentare
Star Strider
am 1 Jun. 2021
As always, my pleasure!
I am happy that you discovered as solution that works!
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!