s1_4.m

来自「里面有论文,matlab的GUI源码,并结合了simulink」· M 代码 · 共 29 行

M
29
字号
%Signal & System 1-4
%建立方波与锯齿波
clf
figure(1)
x=[0:0.01:10];
y=square(pi*x);
subplot(221)
plot(x,y);
axis([0,10,-2,2]);
title('方波');xlabel('x');ylabel('y');

y=square(pi*x,20);
subplot(222)
plot(x,y);
axis([0,10,-2,2]);
title('方波');xlabel('x');ylabel('y');

x=[0:0.01:10];
y=sawtooth(pi*x);
subplot(223)
plot(x,y);
axis([0,10,-2,2]);
title('锯齿波');xlabel('x');ylabel('y');

y=sawtooth(pi*x,0.5);
subplot(224)
plot(x,y);
axis([0,10,-2,2]);
title('锯齿波');xlabel('x');ylabel('y');

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?