How to plot a cross-section of a surface plot
44 views (last 30 days)
Show older comments
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?
0 Comments
Accepted Answer
Fangjun Jiang
on 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);
More Answers (1)
Jul Smith
on 17 May 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
0 Comments
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!