3D plotting in Matlab

2 次查看(过去 30 天)
shraddha s
shraddha s 2016-11-23
评论: Star Strider 2016-11-24
How to plot a 3d 'U' shape in MATLAB parallel to XY plane?
  2 个评论
Dcember
Dcember 2016-11-23
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 2016-11-23
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.

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2016-11-23
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 个评论
Star Strider
Star Strider 2016-11-24
As always, my pleasure!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Labels and Styling 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by