How to plot a cross-section of a surface plot

44 Ansichten (letzte 30 Tage)
Shayan
Shayan am 5 Aug. 2011
I have a 3D plot that's generated by 3 900x900 matrices X,Y,Z. I want to plot the Z values at X==300micros(note:matrix dimension has nothing to do with values of X dimension) for all values of Y.
Any Idea how I could do this?

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 5 Aug. 2011
I think the function you are looking for is interp2(). For example:
M=10;
N=10;
X=-1:1/M:1;
Y=-1:1/N:1;
Z=membrane(1,M,N);
figure(1);surf(X,Y,Z);
x=0.3;
z=interp2(X,Y,Z,x,Y);
figure(2);plot(Y,z);

Weitere Antworten (1)

Jul Smith
Jul Smith am 17 Mai 2012
Hello, I have a file of contours that I want to visualiza in a cross section and another file of points x,y,z. How can I integrate point data into a cross section of those contours. I have tried interp function without success. Any ideas?
THANKS, Jul

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by