function [routh_list,conclusion] = Routh(chara_equ)
n=length(chara_equ);
chara_equ=reshape(chara_equ,1,n);
if mod(n,2)==0
else
chara_equ=[chara_equ,0];
end
routh=reshape(chara_equ,2,n1);
routh_list=zeros(n,n1);
routh_list(1:2,:)=routh;
i=3;
while 1;
if routh_list(i-1,1)==0 & sum(routh_list(i-1,2:n1))~=0
chara_equ = conv(chara_equ,[1 3]);
n=length(chara_equ);
if mod(n,2)==0
else
chara_equ=[chara_equ,0];
end
routh=reshape(chara_equ,2,n1);
routh_list=zeros(n,n1);
routh_list(1:2,:)=routh;
i=3;
end
ai=routh_list(i-2,1)/routh_list(i-1,1);
for j=1:n1-1
routh_list(i,j)=routh_list(i-2,j+1)-ai*routh_list(i-1,j+1);
end
if sum(routh_list(i,:))==0
k=0;
l=1;
while n-i-k>=0
k=k+2;
l=l+1;
end
routh_list(i,:)=routh_list(i-1,:).*F(1,:);
end
i=i+1;
if i>n
break;
end
end
r=find(routh_list(:,1)<0);
if isempty(r)==1
else
m=n2;
for i=1:n2-1
if r(i+1)-r(i)==1
m=m-1;
end
end
str1='There is ';
if r(n2)==n
str2=num2str(m*2-1);
else
str2=num2str(m*2);
end
str3=' unstable roots!';
end
有点错误 很急 高手帮个忙吧 谢谢 真心感谢