How to Plot multicolor Vector

Hello,
I have a line code which is:
plot(Srn(:,1),'*g')
the vector Srn has 178 elements. How can I plot the range 1-59 in red, 60-131 in black and 132-178 in blue?
Thanks

Respuestas (1)

the cyclist
the cyclist el 26 de Jun. de 2013

2 votos

Here's one way:
figure
hold on
plot(Srn(1:59,1),'*r')
plot(Srn(60:131,1),'*k')
plot(Srn(132:178,1),'*b')

2 comentarios

Wellinton
Wellinton el 27 de Jun. de 2013
thanks
the cyclist
the cyclist el 27 de Jun. de 2013
If you found that my answer solved your question, you may want to officially accept it, which will help people looking for similar solutions in the future.

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 26 de Jun. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by