MATLAB: How to round off the coefficients of sys2 polynomial(num/den)

round off coefficients

num=[1 0 0];
den=[1 0 0 1];
sys=tf(num,den)
sysd=c2d(sys,0.3)
sys2=d2c(sysd)

Best Answer

Hi sadel, I see another hard question :)
num=[1 0 0];
den=[1 0 0 1];
sys=tf(num,den);
sysd=c2d(sys,0.3);
sys2=d2c(sysd);
[num,den] = tfdata(sys2);
num=round(num{:});
den=round(den{:});
sys2simple=tf(num,den)
Be carefull, in your example this code works well enough but please read the documentation about the round function!!!!!
Also take a look at round2