三维针状图
二维针状图与三维针状图无异。在二维中所用指令为stem,三维中为stem3。其余的全都一致。
做以对比:
stem3(x);
stem3(Z);
stem3(X,Y,Z);
stem3(___,'filled');%'filled'表示的是针状为实心
stem3(___,LineSpec);
stem3(___,Name,Value);
一维与三维作对比:
x=0:0.1:4*pi;
y=sin(x).*cos(x);
stem(x,y,'fill')
x=(0:0.1:4*pi);
y=sin(x).*cos(x);
stem3(y)
theta=(-pi:0.05:4*pi);
x=cos(theta);
y=sin(theta);
z=abs(cos(3*theta)).*exp(-abs(theta/3));
stem3(z);
stem3(x,y,z)