I'm trying to write a for loop for the sum A+A^2+A^3+..+A^n.
Here is my code:
function [ x ] = Untitled2( A , n )
The problem I'm having with this is this function is listing the matrix A to each power without adding them. What can I do to add these together? Thank you in advance