for loop for matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
hi everyone,
i need help for my code.
I have one for loop and A matrix, each loop i obtain new matrix, and for each matrix i want to plot the values,
A=10 X 10 continusely renewable matrix, and i want to plot each matrix in same figure,
댓글 수: 0
채택된 답변
Walter Roberson
2021년 5월 10일
편집: Walter Roberson
2021년 5월 10일
A = randi([-9 9], 10, 10)
A = {A};
for K = 1 : 3
A{K+1} = A{K}*A{1};
figure(); surf(A{K+1}); title("iteration " + K)
end
댓글 수: 3
Walter Roberson
2021년 5월 10일
for cc = 1 : 3
U(:,26) = U(:,26) + randn(size(U,1),1); %or whatever change is appropriate
plot(xx, U(:,26))
title("iteration " + cc);
hold on
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!