Marking the peak of a plot automatically without having to click on it
Afficher commentaires plus anciens
Hi,
Is it possible to mark the peak of a plot automatically with a command without having to to mark on each plot.
Réponse acceptée
Plus de réponses (3)
Wayne King
le 29 Août 2012
Do you know the value of the peak?, then yes, it's easy.
x = randn(100,1);
[val,I] = max(x);
plot(x); hold on;
plot(I,val,'r^','markerfacecolor',[1 0 0])
7 commentaires
Lisa Justin
le 29 Août 2012
Modifié(e) : Lisa Justin
le 29 Août 2012
Tom
le 29 Août 2012
are you looking for one single maximum value, or are you looking for local peaks (i.e. the peaks of a sine wave where there can be several per plot)?
Lisa Justin
le 29 Août 2012
Tom
le 29 Août 2012
Then Wayne's code above should work fine.
Lisa Justin
le 29 Août 2012
Tom
le 29 Août 2012
It should be; can you provide some sample data?
Ilham Hardy
le 29 Août 2012
Below link is the 'how-to' display tooltip syntactically..
Happy reading,
Ilham Hardy
le 29 Août 2012
0 votes
4 commentaires
Lisa Justin
le 29 Août 2012
Modifié(e) : Lisa Justin
le 29 Août 2012
Jan
le 29 Août 2012
Then use the output of the peakfinder and a simple TEXT command.
Lisa Justin
le 29 Août 2012
Jan
le 29 Août 2012
See "help text" and "doc text".
Sergio Yanez-Pagans
le 28 Mar 2021
0 votes
You could use my MATLAB File Exchange function:
Hope you find this useful!
Catégories
En savoir plus sur Descriptive Statistics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!