How can I mark specific indexes on a plot?
62 views (last 30 days)
KSSV on 6 Dec 2020
If (x,y) is your data and id1 and id2 are the indices. Use:
id = [id1 id2] ;
Steven Lord on 6 Dec 2020
Edited: Steven Lord on 6 Dec 2020
You could use the MarkerIndices property of the line object returned by plot or you could use xline depending on how you want those points marked.
x = 0:360;
y = sind(x);
plot(x, y, 'ro-','MarkerIndices', (0:45:360)+1)
plot(x, y, 'r-')
for multiplesOf45 = 0:45:360