How can I store and sum matrix using loop for?
이전 댓글 표시
Hi threre.
I have the following matrices and the code I am running to get the sum of matrices:
A = sparse matrix (20000x20000)
I = matrix identity of A
for ii = 1:200
C{ii} = A^ii;
L = I + C{ii};
end
What I would like to get as result is L = I+C{1}+C{2}+C{3}...+C{200}.
However I am getting L = I+C{200}.
Could you help me to find the mistake, please?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!