How can I mark specific indexes on a plot?
49 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have file with the breathing of sick people. These breathing sounds have wheezes in it. I had the plot drawn. I also have the start and end indexes of wheezing. How can I mark these indexes on the plot?
0 Kommentare
Antworten (2)
KSSV
am 6 Dez. 2020
If (x,y) is your data and id1 and id2 are the indices. Use:
plot(x,y,'b')
hold on
id = [id1 id2] ;
plot(x(id),y(id),'*r')
0 Kommentare
Steven Lord
am 6 Dez. 2020
Bearbeitet: Steven Lord
am 6 Dez. 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)
figure
plot(x, y, 'r-')
for multiplesOf45 = 0:45:360
xline(multiplesOf45)
end
Siehe auch
Kategorien
Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!