How to write the script for iteration when the input is the matrix?
1 view (last 30 days)
Show older comments
Nunoy Female
on 29 Jun 2015
Commented: Nunoy Female
on 29 Jun 2015
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.
0 Comments
Accepted Answer
Walter Roberson
on 29 Jun 2015
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.
More Answers (0)
See Also
Categories
Find more on Multidimensional Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!