how can i insert in plot different values
1 次查看(过去 30 天)
显示 更早的评论
how can i make a code that repeats the plot command and for each different iteration has different results
My Board X (20x5)
fu*nction [Y] = PlotProduct(X,Names)
for N = 1: 5;
figure;
plot(X);
title(Names{N});
xlabel('PRICES');
end
0 个评论
采纳的回答
Sulaymon Eshkabilov
2021-5-25
Hi,
Here is a simple solution:
Names={'One', 'Two', 'Three', 'Four', 'Five'};
X = randi([0, 13], 5, 15);
for N = 1: 5
figure(N)
PlotProduct(X(N, :), Names{N})
end
function [Y] = PlotProduct(X,Names)
plot(X);
title(Names);
xlabel('PRICES');
end
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!