different color to plot

1 次查看(过去 30 天)
Luca Re
Luca Re 2024-5-2
编辑: Paul 2024-5-2
hi,it' possible to plot in different color? (example : line color yellow but the last point are colored in black)

采纳的回答

Paul
Paul 2024-5-2
编辑:Paul 2024-5-2
There may be fancy way to do it with a single line (or other type of) object, but it's easy to do it with two
t = 0:.01:1;
y = sin(2*pi*10*t);
figure
ii = find(t <= 0.35);
plot(t(ii),y(ii),'r',t(ii(end):end),y(ii(end):end),'k')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by