3D plotting in Matlab

2 visualizaciones (últimos 30 días)
shraddha s
shraddha s el 23 de Nov. de 2016
Comentada: Star Strider el 24 de Nov. de 2016
How to plot a 3d 'U' shape in MATLAB parallel to XY plane?
  2 comentarios
Dcember
Dcember el 23 de Nov. de 2016
Hope it helps:
[y,z]=meshgrid(linspace(-10,10));
x=y.^4;
surf(x,y,z)
xlabel('x')
ylabel('y')
zlabel('z')
shraddha s
shraddha s el 23 de Nov. de 2016
Thanks for replying. I want to display simple U shape in 3D(not meshgrid) which will be parallel to XY plane. How to do that? I tried to plot a parabola but it does not look like U.

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 23 de Nov. de 2016
Try this:
x = linspace(-pi*0.49, pi*0.49);
y = abs(tan(x));
z = 5*ones(size(x));
figure(1)
plot3(x, y, z, 'LineWidth',2)
grid on
producing:
  4 comentarios
shraddha s
shraddha s el 24 de Nov. de 2016
Thanks!
Star Strider
Star Strider el 24 de Nov. de 2016
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Labels and Styling en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by