how to make a single plot with different colors?

2 次查看(过去 30 天)
x=1:10;
y=1:10;
plot(x,y)
How to make one color from 1 to 5 ,,,and 6 to 10 another plot?

采纳的回答

Iman Ansari
Iman Ansari 2013-4-17
Hi
x=1:10;
y=1:10;
plot(x(1:5),y(1:5),'r')
hold on
plot(x(5:10),y(5:10),'g')

更多回答(0 个)

类别

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