Writing a loop to create a matrix
Show older comments
if N==1
Lambda = A;
elseif N==2
Lambda = [A A^2]';
elseif N==3
Lambda = [A A^2 A^3]';
elseif N==4
Lambda = [A A^2 A^3 A^4]';
elseif N==5
Lambda = [A A^2 A^3 A^4 A^5]';
end
Given that A is a matrix, how do I create a loop that creates:
Lambda = [A A^2 A^3... A^(N-2) A^(N-1) A^N]';
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements 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!