MATLAB: How to write the script for iteration when the input is the matrix

iterationmatrix

for example, I have one iteration such as x_{n+1}=ax_n+bAx_n. where a,b are real numbers and A is 3×3 matrix.
My problem is x_n is not a real number but it is in the form of matrix (3×1 dimension). How could I write the script for running this iteration? Thank you so much in advance.

Best Answer

x_n = x; %original value
for n = 1 : maximum_n - 1
x_n(:,n+1) = a * x_n(:,n) + b * A * x_n(:,n);
end
The values will appear down the columns.