different color to plot

7 ビュー (過去 30 日間)
shamal
shamal 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 Center および File Exchange2-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