Clear Filters
Clear Filters

different color to plot

2 views (last 30 days)
Luca Re
Luca Re on 2 May 2024
Edited: Paul on 2 May 2024
hi,it' possible to plot in different color? (example : line color yellow but the last point are colored in black)

Accepted Answer

Paul
Paul on 2 May 2024
Edited: Paul on 2 May 2024
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')

More Answers (0)

Community Treasure Hunt

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

Start Hunting!