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
回答(1 个)
the cyclist
2013-6-26
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 个评论
Wellinton
2013-6-27
the cyclist
2013-6-27
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.
类别
在 帮助中心 和 File 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!