矩形脉冲信号:rectpuls(t, width) 周期矩形脉冲信号:square(t, DUTY) 三角波脉冲信号:tripuls(t, width, skew) 周期三角波信号:sawtooth(t, width) 单位阶跃信号:y=(t>=0)这五个信号的代码
时间: 2023-08-01 18:06:04 浏览: 196
好的,以下是这五个信号的 MATLAB 代码:
1. 矩形脉冲信号:`rectpuls(t, width)`
```
t = -5:0.1:5;
width = 2;
y = rectpuls(t,width);
plot(t,y);
```
2. 周期矩形脉冲信号:`square(t, DUTY)`
```
t = -5:0.01:5;
DUTY = 30;
y = square(2*pi*t, DUTY);
plot(t,y);
```
3. 三角波脉冲信号:`tripuls(t, width, skew)`
```
t = -5:0.1:5;
width = 2;
skew = 0.5;
y = tripuls(t,width,skew);
plot(t,y);
```
4. 周期三角波信号:`sawtooth(t, width)`
```
t = -5:0.01:5;
width = 2;
y = sawtooth(2*pi*t/width);
plot(t,y);
```
5. 单位阶跃信号:`y=(t>=0)`
```
t = -5:0.1:5;
y = (t>=0);
plot(t,y);
```
阅读全文