How to create 3D-Plot in MatLab?

2019-02-21 08:42发布

Please help me to create 3D-Plot in MatLab with this parameters:

x=t
y=t
z=2t^2
0<t<1

thank you!

标签: matlab 3d plot
1条回答
甜甜的少女心
2楼-- · 2019-02-21 09:25

Matlab plots data, not functions. So, you need to generate data that represents your function. Here I generate a vector containing 100 values of t from 0 to 1 (you could use linspace() for this if you prefer), then use it to generate the x, y, and z values:

t = [0 : 0.01 : 1]';
x = t;
y = t;
z = 2 * t.^2;

plot3(x,y,z, 'r-');

The plot3() call generates the plot as a red line connecting your x, y, z data points.

查看更多
登录 后发表回答