extracting a 2d plane from a 3d surface plot
6 ビュー (過去 30 日間)
古いコメントを表示
Hi guys, sorry if this is an easy question but I'm new to matlab. I've done a surface plot with two 3-d planes in it. I have vectors x.dat and y.dat, and the 2 by 2 matrices z1.dat and z2.dat. I can plot both of these surfaces on one figure by
load x.dat
load y.dat
load z1.dat
load z2.dat
hold on;
surf(x,y,z1,'FaceColor',[1 0 0],...
'EdgeColor',[1 0 0]);
surf(x,y,z2,'FaceColor',[0 0 1],...
'EdgeColor',[0 0 1]);
hold off;
This plots z1 and z2 nicely in 3d space with one of them blue and the other red. What I'd like to do is plot the plane z=0, to show the intersection of z1 and z2 in the x-y plane at z=0. Is this possible to do with matlab? Thanks in advance for any suggestions.
0 件のコメント
採用された回答
Richard Brown
2012 年 4 月 21 日
How about
contour(x, y, z1-z2, [0 0])
?
2 件のコメント
Richard Brown
2012 年 4 月 21 日
Cool, sorry -- I read your question a bit fast! Glad you got it sorted
その他の回答 (1 件)
Richard Brown
2012 年 4 月 21 日
Plotting the plane is pretty easy
surf(x, y, zeros(size(x))
You can adjust colour, edgecolor, transparency etc if you want. Is that what you were after?
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!