当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


MATLAB plot3()用法及代码示例


plot3 函数显示一组数据点的三维图。

用法

plot3(X1,Y1,Z1,...) // where X1, Y1, Z1 are vectors or matrices, plot one or more lines in 3-D space through the points whose points are the items of X1, Y1, and Z1.
plot3(X1,Y1,Z1,LineSpec,...) // It develop and shows all the lines described by the Xn,Yn,Zn,LineSpec quads, where LineSpec is a line specification that define line style, marker symbol, and color of the plotted lines.
plot3(...,'PropertyName',PropertyValue,...) // It sets properties to the specified property values for all Line graphics objects generated by plot3.
h = plot3(...) // It returns a column vector of handles to line graphics objects, with one handle per line.

示例

绘制参数空间曲线:

x(t)=t,y(t)=t^2,z(t)=t^3.
0≤t≤1
t= linspace (0, 1,100);
x=t; y=t.^2; z=t.^3;
plot3(x, y, z), grid
xlabel ('x(t)=t')
ylabel ('y(t)=t2')
zlabel ('z(t)=t3')

输出:

MATLAB plot3()



相关用法


注:本文由纯净天空筛选整理自 MATLAB plot3()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。