function Sysc=dls2cls(Sysd,T)
    s=poly(0,'s');
    z=poly(0,'z');
    numdeg = degree(Sysd.num);
    dendeg = degree(Sysd.den);
    if  numdeg>dendeg
        error('The discrete-time system is improper');
    end
    f = -(s*T+2);
    g = (s*T-2);
    bn = coeff(Sysd.num);
    an = coeff(Sysd.den);
    npad = dendeg - numdeg;
    if npad>0
        for i=0:npad
            bn = [bn 0];
        end
    end
    nums = 0;
    dens = 0;
    for i=0:dendeg
        nums = nums + bn(i+1)*(f^i)*(g^(dendeg-i));
        dens = dens + an(i+1)*(f^i)*(g^(dendeg-i));
    end
    Sysc = syslin('c',nums,dens);
endfunction

// Commandes à effectuer pour identifier un systeme :

/*
p=poly(0,'p')
syslin('c',1/(p/5e-3+1))
H = syslin('c',1/(p/5e-3+1))
Te = 0.5
 u =[zeros(1,1000),ones(1,1000)]
 ym = csim(u,(1:2000)*Te,H)
 Hi  = armax(1,1,ym,u)
 plot(arsimul(Hi,u))
 arma2p(Hi)
 arma2ss(Hi)
 ss2tf(arma2ss(Hi))
 tf2ss(H)
 cls2dls(H)
 cls2dls(tf2ss(H),0.5)
 S = cls2dls(tf2ss(H),0.5)
 ss2tf(S)
 Sysc=dls2cls(ans,0.5)
 */
 
 
 
 
