plotting multiple graphs in different colors with a single command

조회 수: 1 (최근 30일)
cgo
cgo 2017년 8월 9일
편집: José-Luis 2017년 8월 9일
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
Stephen23
Stephen23 2017년 8월 9일
"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?

댓글을 달려면 로그인하십시오.

답변 (1개)

José-Luis
José-Luis 2017년 8월 9일
편집: José-Luis 2017년 8월 9일
plot(distance_from_herder(1:length,1:11));
Please read the documentation.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by