# Get values of the particular line from surf plot

1 visualización (últimos 30 días)
Ramesh Bala el 3 de Sept. de 2021
Comentada: Ramesh Bala el 3 de Sept. de 2021
I'm intersted to get all the values of the line 2- curve - marked in figure
A1 = jj;
figure
A1(A1>0.05) = NaN;
figure
figure
v = [0.045 0.055];
How Shall I get only this lower curve in a separate figure and then get all the Y values ?
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Konrad el 3 de Sept. de 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:
figure
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.
##### 3 comentariosMostrar 1 comentario más antiguoOcultar 1 comentario más antiguo
Konrad el 3 de Sept. de 2021
Try
figure;
plot(contSubset(1,:),contSubset(2,:),'.'); % 1st row of contSubset is used as x-coordinates and 2nd row as y-ccordinates
set(gca,'Xlim',[1 234],'YLim',[1 2643])
this should look like the region marked in your figure.
Ramesh Bala el 3 de Sept. de 2021
Thank you so much Konrad .The lines made was so user friendly and quick.

Iniciar sesión para comentar.

### Categorías

Más información sobre Image Segmentation 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