怎么用MATLAB S函数实现下面的差分方程组?X1(k)=0.5*|X2(k-1)|/t1(k-1) X2(k)=-0.5*X1(k)/t2(k)

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 10:43:56
怎么用MATLABS函数实现下面的差分方程组?X1(k)=0.5*|X2(k-1)|/t1(k-1)X2(k)=-0.5*X1(k)/t2(k)怎么用MATLABS函数实现下面的差分方程组?X1(k)

怎么用MATLAB S函数实现下面的差分方程组?X1(k)=0.5*|X2(k-1)|/t1(k-1) X2(k)=-0.5*X1(k)/t2(k)
怎么用MATLAB S函数实现下面的差分方程组?X1(k)=0.5*|X2(k-1)|/t1(k-1) X2(k)=-0.5*X1(k)/t2(k)

怎么用MATLAB S函数实现下面的差分方程组?X1(k)=0.5*|X2(k-1)|/t1(k-1) X2(k)=-0.5*X1(k)/t2(k)
仔细看看吧!由于在matlab中x(k)k的值不能从0开始!所以就写了下面的m文件;看看吧!
function mufun()
% X1(k)=0.5*X2(k-1)/t1(k-1)
% X2(k)=-0.5*X1(k)/t2(k)
n=5;
X2(1)=1;
t1=[1 2 3 4];
t2=[1 2 3 4 5];%t2(1)用不到
for k=2:n
X1(k)=0.5*X2(k-1)/t1(k-1);
X2(k)=-0.5*X1(k)/t2(k);
end
X1,X2