I am doing long division on a polynomial fraction for a power series and I can't figure out how to do it on a Ti nspire. I figured it out in Matlab and now I want to write the same routine on the calculator. I need to find the equivalent syntax for arrays or lists. Can anyone help? Can a calculator do the same thing as the matlab code?

rmd(i:9)=rmd(i:9)-qd(1:10-i); % this is the syntax I need an equivalent for

polynomial fraction

0.2/(z^4-0.4z^3+0.646z^2-0.243z+0.024)

this is the code for the power series up to 9 terms.

rmd= [0.2 0 0 0 0 0 0 0 0]; %numerator coefficient

q= [0 0 0 0 0 0 0 0 0 0]; %quotient

qd=[0 0 0 0 0 0 0 0 0 0]; % product of quotient term with denominator

d=[1 -0.4 0.6465 -0.2426 .02426 0 0 0 0];%denominator

rmd(i:9)=rmd(i:9)-qd(1:10-i);

r= [0.2 0 0 0 0 0 0 0 0];

q= [0 0 0 0 0 0 0 0 0 0];

qd=[0 0 0 0 0 0 0 0 0 0];

d=[1 -0.4 0.6465 -0.2426 .02426 0 0 0 0];

rmd=r;

i=1;

for i=1:9

q(i)=rmd(i)/d(1);

qd=q(i)*d;

rmd(i:9)=rmd(i:9)-qd(1:10-i);

end