how can i insert in plot different values
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
andrew moisidi
am 25 Mai 2021
Kommentiert: andrew moisidi
am 26 Mai 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 Kommentare
Akzeptierte Antwort
Sulaymon Eshkabilov
am 25 Mai 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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!