how can i insert in plot different values
1 view (last 30 days)
Show older comments
andrew moisidi
on 25 May 2021
Commented: andrew moisidi
on 26 May 2021
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 Comments
Accepted Answer
Sulaymon Eshkabilov
on 25 May 2021
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
More Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!