I'm completely new to MATLAB, and I can't figure out how to do the following: I have
A=[-1,0.4,0.8;1,0,0;0,1,0];
b=[0;0.3;6];
What I want to do is define, for $N$ fixed but arbitrary, a $3\times N$ matrix C by having the $i$th column of C be $A^{(N-i)}b$. Without doing the calculations separately beforehand, how can I have MATLAB compute and set C as this matrix?
Note that the first column of C will be equal to $A^{N-1}b$, while the last column will be equal to $b$. If you wanted them to be $A^Nb$ and $Ab$ respectively then replace the fourth line of the code with
Edit: The code in littleO's answer is much faster. Mine is an example of what you shouldn't do (at least when you care about efficiency)!