Is there a way to pass in a matrix of color values (n*3) into plot in matlab

2 visualizaciones (últimos 30 días)
Can i pass in a matrix of color values into matlab plot function, such that it colors each of my line plots a different color in one go instead of using a for loop.

Respuestas (1)

KSSV
KSSV el 18 de Feb. de 2020
You need not use a loop..you can make your data a matrix and use plot.
X = repmat(1:10,10,1) ;
Y = rand(10) ;
plot(X',Y')

Categorías

Más información sobre Colormaps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by