如何创建三维绘图在MATLAB? [英] How to create 3D-Plot in MatLab?

查看:206
本文介绍了如何创建三维绘图在MATLAB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮我打造的3D绘图用Matlab这个参数:

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

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

谢谢!

推荐答案

Matlab的曲线数据,而不是功能。所以,你需要生成重新presents你的函数的数据。在这里,我生成一个包含从0到1的 T 100值的向量(你可以使用linspace()这个,如果你preFER),然后用它来生成的x,y,和z值:

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-');

在plot3()调用生成的情节作为一条红线连接你的X,Y,Z数据点。

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

这篇关于如何创建三维绘图在MATLAB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆