Get values of the particular line from surf plot

1 view (last 30 days)
I'm intersted to get all the values of the line 2- curve - marked in figure
A1 = jj;
A1(A1>0.05) = NaN;
surf(A1);shading interp;view(2);
contour(A1); shading interp; view(2)
v = [0.045 0.055];
contour3(A1,v); shading interp; view(2)
How Shall I get only this lower curve in a separate figure and then get all the Y values ?

Accepted Answer

Konrad on 3 Sep 2021
Hi Ramesh,
the contour3() function returns the contour matrix (see help) containing x- and y-coordinates of the contour. You can use these to extract the desired part of the contour:
v = [0.045 0.055];
contMat = contour3(A1,v); shading interp; view(2)
idx = contMat(1,:)>60 & contMat(2,:) < 850;
contSubset = contMat(:,idx);
Now contSubset contains x coordinates of the marked part in the first row and y coordinates in the second row.
Best, Konrad
Ramesh Bala
Ramesh Bala on 3 Sep 2021
Thank you so much Konrad .The lines made was so user friendly and quick.

Sign in to comment.

More Answers (0)


Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by