sawt.m
来自「一种新的时频分析方法的matlab源程序。」· M 代码 · 共 33 行
M
33 行
function z=sawt(t)
% The function SAWT generates a triangle saw tooth function.
%
% Calling sequence-
% z=sawt(t)
%
% Input-
% t - column vector data t(n)
% Output-
% z - column vector data z(n) that specifies the values
% of a triangle saw tooth function
% Z.Shen Initial
%----- Initialize
n=length(t);
z=zeros(n,1);
T=2.*pi; %period
T1=T/2.;
%----- Generate the values
for i=1:n
x=mod(t(i),T);
if x <= T1
z(i)=-1.+2./T1*x;
else
x1=x-T1;
z(i)=1-2./T1*x1;
end
end
return
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?