Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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) ?

Respuesta aceptada

Matt J
Matt J el 18 de Jun. de 2021
Editada: Matt J el 18 de Jun. de 2021
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 comentario
Mesbahose Salekeen
Mesbahose Salekeen el 18 de Jun. de 2021
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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by