How to plot multiple Loops and draw data lables for legend
이전 댓글 표시
Hi
I want to plot return value C and add legend according to iteration for below code
A = [1:4];
B = [1:4];
C = zeros(size(A,2),size(B,2));
for i = 1:length(A)
for j = 1:length(B)
C(i,j) = power(A(i),B(j));
end
end
댓글 수: 3
KSSV
2021년 9월 24일
Loop not required:
C = (A').^B ;
How would like to add legend? Do you have any demo picture?
Life is Wonderful
2021년 9월 24일
편집: Life is Wonderful
2021년 9월 24일
Life is Wonderful
2021년 9월 24일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


