plotting multiple graphs in different colors with a single command

1 Ansicht (letzte 30 Tage)
cgo
cgo am 9 Aug. 2017
Bearbeitet: José-Luis am 9 Aug. 2017
Hi,
I have a matrix of size 500 x 11, each column represents a particle evolving over time (rows). I want to plot all particles in a single command,
for n = 1:11
plot(1:length, [distance_from_herder(1:length,n)])
hold on
end
But I want each plot to have a separate colour from each other. How do I add the colors in this command?
  1 Kommentar
Stephen23
Stephen23 am 9 Aug. 2017
"But I want each plot to have a separate colour from each other."
That is exactly what plot does when you call it once with the required data. Did you try that?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

José-Luis
José-Luis am 9 Aug. 2017
Bearbeitet: José-Luis am 9 Aug. 2017
plot(distance_from_herder(1:length,1:11));
Please read the documentation.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by