%功能:火柴杆图绘制函数stem实例应用
t=0:.2:10;
y=exp(-0.5*t).*sin(7*t);
subplot(211)
stem(t,y)
title('空心头型显示')
hold on
plot(t,y)
plot(t,y,'r')
xlabel('X')
ylabel('Y')
subplot(212)
stem(t,y,'-.dg','fill')
title('实心头型显示')
xlabel('X')
ylabel('Y')
开发工具:MATLAB 2022b
微信Alt+A截屏工具
本程序摘自《MATLAB 2008图形与动画实例教程》