smilingbuddha
smilingbuddha

Reputation: 14764

SLicing a 3-d plot in MATLAB

Suppose in MATLAB I have obtained a 3-D plot, like surf(peaks(20)) how do I get a slice along the plane X=0, and the corresponding 2-D plot?

Upvotes: 4

Views: 265

Answers (1)

Alex
Alex

Reputation: 5893

You can make a contour plot:

data = peaks(50);

figure;
surf(data);

figure;
[C,h] = contour(data, [0 0]);
clabel(C,h);

Upvotes: 5

Related Questions