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,

 채택된 답변

Walter Roberson
Walter Roberson 2021년 5월 10일
편집: Walter Roberson 2021년 5월 10일

0 개 추천

A = randi([-9 9], 10, 10)
A = 10×10
-2 -3 1 4 -6 -6 7 -8 -5 -9 -2 4 3 -1 6 4 3 -6 1 5 2 -5 -4 3 -9 -5 9 7 -4 -6 4 9 7 -5 -4 -8 9 -7 7 -5 -7 4 -5 5 -5 -7 9 -4 -7 -3 -7 3 9 -2 2 -8 8 7 -7 -8 -4 -4 0 -5 -8 2 -2 -8 5 1 -1 3 -3 5 -9 -4 3 -4 -3 -7 -9 -2 6 9 8 -7 -4 -8 -8 -1 5 -8 -1 -1 -7 2 0 -8 -8 -4
A = {A};
for K = 1 : 3
A{K+1} = A{K}*A{1};
figure(); surf(A{K+1}); title("iteration " + K)
end

댓글 수: 3

this is not working with me actualli, because i have two matrix that i need to plot.
U is 401x26 matrix
xx is 401x1 matrix
i am putting this condition to be solved. but does not looks like good. even i am obtaining three different graphes. not all three in same figure. could you help me with this. thanks
for cc=1:3
if cc==1,
figure(1); hold on; plot(xx,U(:,26)); title("iteration " + cc)
elseif cc==2,
figure(2); hold on; plot(xx,U(:,26)); title("iteration " + cc)
else
figure(); hold on; plot(xx,U(:,26)); title("iteration " + cc)
end
end
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
mehmet salihi
mehmet salihi 2021년 5월 10일
that is awesome, thank you very much

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2021년 5월 10일

댓글:

2021년 5월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by