matlab 中如何定义周期函数
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/03 15:10:31
matlab 中如何定义周期函数
具体点:已知周期为T=4的三角波,在第一周期内的表达式为:x=1-abs(t) (-2
具体点:已知周期为T=4的三角波,在第一周期内的表达式为:x=1-abs(t) (-2
其实 MATLAB里面有直接定义三角波的函数的
就是 sawtooth(t,width) 其用法跟sin(t)差不多.
比方说你的条件是x=1-abs(t) (-2<t<2)
下面是代码:
clear all
clc
t=-4:0.01:4;
f=sawtooth(1/2*pi*(t+2),0.5);
plot(t,f);
grid on;
最后附上一些函数吧
特殊函数
boxcar() 矩形窗
triang() 三角窗
tripuls() 非周期三角脉冲
sawtooth() 锯齿波
rectpuls() 非周期矩形脉冲
square() 方波
sinc() sinc函数
diric() 冲击函数
![](http://img.wesiedu.com/upload/4/e3/4e326ee2672ed69ad936db5f7a4794be.jpg)
就是 sawtooth(t,width) 其用法跟sin(t)差不多.
比方说你的条件是x=1-abs(t) (-2<t<2)
下面是代码:
clear all
clc
t=-4:0.01:4;
f=sawtooth(1/2*pi*(t+2),0.5);
plot(t,f);
grid on;
最后附上一些函数吧
特殊函数
boxcar() 矩形窗
triang() 三角窗
tripuls() 非周期三角脉冲
sawtooth() 锯齿波
rectpuls() 非周期矩形脉冲
square() 方波
sinc() sinc函数
diric() 冲击函数
![](http://img.wesiedu.com/upload/4/e3/4e326ee2672ed69ad936db5f7a4794be.jpg)