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!


