How to write the script for iteration when the input is the matrix?

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

 Réponse acceptée

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.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by