
How to get coordinates for a specific contour line?
45 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sk Zeeshan Ali
am 20 Jan. 2020
Bearbeitet: Sk Zeeshan Ali
am 17 Feb. 2020
I have the program as follows:
x = -2:0.2:2;
y = -2:0.2:3;
[X,Y] = meshgrid(x,y);
Z = X.*exp(-X.^2-Y.^2);
contour(X,Y,Z)
Now, I want to get a two-column matrix C that will give the (x,y) coordinates of a specific contour line, let us say for Z = 0.1. So, how to get this two-column matrix?
0 Kommentare
Akzeptierte Antwort
Claudio Iturra
am 20 Jan. 2020
Bearbeitet: Image Analyst
am 21 Jan. 2020
x = -2:0.2:2;
y = -2:0.2:3;
[X,Y] = meshgrid(x,y);
hold on % to your meshgrid a specific value for your contour.
[x1,y1] = contour(X,Y,Z,[0.1 0.1],'*k') % x1 will be your "two-column matrix"

1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!