Marking the peak of a plot automatically without having to click on it
Mostrar comentarios más antiguos
Hi,
Is it possible to mark the peak of a plot automatically with a command without having to to mark on each plot.
Respuesta aceptada
Más respuestas (3)
Wayne King
el 29 de Ag. de 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 comentarios
Lisa Justin
el 29 de Ag. de 2012
Editada: Lisa Justin
el 29 de Ag. de 2012
Tom
el 29 de Ag. de 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
el 29 de Ag. de 2012
Tom
el 29 de Ag. de 2012
Then Wayne's code above should work fine.
Lisa Justin
el 29 de Ag. de 2012
Tom
el 29 de Ag. de 2012
It should be; can you provide some sample data?
Ilham Hardy
el 29 de Ag. de 2012
Below link is the 'how-to' display tooltip syntactically..
Happy reading,
Ilham Hardy
el 29 de Ag. de 2012
0 votos
4 comentarios
Lisa Justin
el 29 de Ag. de 2012
Editada: Lisa Justin
el 29 de Ag. de 2012
Jan
el 29 de Ag. de 2012
Then use the output of the peakfinder and a simple TEXT command.
Lisa Justin
el 29 de Ag. de 2012
Jan
el 29 de Ag. de 2012
See "help text" and "doc text".
Sergio Yanez-Pagans
el 28 de Mzo. de 2021
0 votos
You could use my MATLAB File Exchange function:
Hope you find this useful!
Categorías
Más información sobre Descriptive Statistics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!