MATLAB Answers

Incrementally increase power of a matrix

1 view (last 30 days)
Isha Malekar
Isha Malekar on 29 Jun 2020
Commented: Isha Malekar on 29 Jun 2020
I want to create an array "M" with incremnatlly increasing power of matrix A = [3 5 2; 1 0 9; 10 8 11];
Such that M=[I; A; A^2; A^3; ..... A^n]; Where A^2=A*A & not A.^2

  0 Comments

Sign in to comment.

Answers (1)

madhan ravi
madhan ravi on 29 Jun 2020
n = 10;
m = arrayfun(@(x) A^x, 0:n, 'un', 0)
M = cat(1, m{:})

Community Treasure Hunt

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

Start Hunting!