Problem with 3D plotting

1 次查看(过去 30 天)
Tina
Tina 2013-2-24
Hi!
Lets say I have these matrices: B=1x3 C=1x3 D=3x3 I want to have a 3D plot of D vs B-C plane. How can I do this? I read the help for the surface command but seems like I cant use it like this.

采纳的回答

Youssef  Khmou
Youssef Khmou 2013-2-24
编辑:Youssef Khmou 2013-2-24
hi, 1. You can use plot3 :
>>B=rand(3,1);
>>C=rand(3,1);
>>D=rand(3,3);
>>plot3(B,C,D)
As size(D)=[3 3] then it is like you do
>>figure, plot3(B,C,D(:,1))
>>hold on, plot3(B,C,D(:,2))
>>plot3(B,C,D(:,3))
>>hold off
2.Or simply surf/mesh if D=F(B,C) :
>>mesh(D)
>>surf(D)
3.try other features :
doc surfl
doc contour
  2 个评论
Tina
Tina 2013-2-24
The problem is that D is not a function of B and C, and I want to plot the surface of it
Youssef  Khmou
Youssef Khmou 2013-2-24
编辑:Youssef Khmou 2013-2-24
Its fine, try directly
>>surf(D), shading interp
>>mesh(D)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by