How to plot 3d plane of type where one variable is missing like x + y = 0.....

4 次查看(过去 30 天)
x = -2:.05:2;
y = -2:.05:2;
[X,Y] = meshgrid(x,y);
now how do i define Z to relate with X,Y to create plane so i can do surf(X,Y,Z) ?

采纳的回答

Matt J
Matt J 2021-6-18
编辑:Matt J 2021-6-18
If you mean that you have a plane equation of the form a*x+b*y+0*z=d, then you can use
obj=planarFit.groundtruth([],[a,b,0],d);
obj.showfit
xlabel X, ylabel Y, zlabel Z
  1 个评论
Mesbahose Salekeen
Mesbahose Salekeen 2021-6-18
i figured an easy way now
t = linspace(-1,1,50);
x = t;
z = linspace(-5,5,50);
[X,Z] = meshgrid(x,z);
Y = X;
surf(X,Y,Z)
this will create planer surface of x - y = 0

请先登录,再进行评论。

更多回答(0 个)

类别

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

标签

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by