1、打开matlab软件。
如图1所示。

2、命令行键入:
x=linspace(0,8*pi,40);
y=sin(x);
3、命令行键入:
stairs(y);
如图2所示。

4、命令行键入:
stem(y);
如图3所示。

5、命令行键入:
subplot(1,2,1);
stairs(y);
subplot(1,2,2);
stem(y);
6、按“Enter”键。
如图4所示。

时间:2026-02-15 19:34:07
1、打开matlab软件。
如图1所示。

2、命令行键入:
x=linspace(0,8*pi,40);
y=sin(x);
3、命令行键入:
stairs(y);
如图2所示。

4、命令行键入:
stem(y);
如图3所示。

5、命令行键入:
subplot(1,2,1);
stairs(y);
subplot(1,2,2);
stem(y);
6、按“Enter”键。
如图4所示。
