No BSD License  

Highlights from
pole-placement design (' diophantine ')

image thumbnail
from pole-placement design (' diophantine ') by abdelhamid alhassi
this program measures the parameters of forward path gain and the feedback gain

[F G]=dio(a,b,am)
function [F G]=dio(a,b,am)
% Dio is a function designed by MAHFY and it:
% measures the parameters of forward path gain and the feedback gain
m=length(b)-1;
n=length(a)-1;
l=m+n;
aa=zeros(1,length(a)+2*(m-1));
for i=1:(length(a))
    aa(1,i+m-1)=a(1,i);
end
for k=1:l
    c=0;
    for i=1:m
        ax(k,i)=aa(1,k+(m-1)-c);
        c=c+1;
    end
end
bb=zeros(1,length(b)+2*(n-1));
for i=1:(length(b))
    bb(1,i+n-1)=b(1,i);
end
for k=1:l
    c=0;
    for i=1:n
        bx(k,i)=bb(1,k+(n-1)-c);
        c=c+1;
    end
end
x=[ax bx];
for i=1:l
    xx=x;
    xx(:,i)=am(1,:);
    f(i)=det(xx)/det(x);
end
F(:,:)=f(:,1:m);
G(:,:)=f(:,m+1:l);

Contact us at files@mathworks.com