# How can i plot peaks?

9 visualizaciones (últimos 30 días)
m c el 24 de Abr. de 2013
Hi, first off all i want to excuse me if a post wrong. I'm new on mathworks and i've got a big problem.I want to make a GUI in matlab with axes and i don't know how to put on graphic the values of the maximum and minimum peaks. A bit of program look like this:
S=0.275
t=0:0.1:6;
n=10/64;
omega=(2*pi*n)
d=S*(1-cos(omega*t))/2
plot(handles.axes1,omega*t,d)
What i want is to show me on the axes the maximum and minimum values for "d" whatever values i've got to put on S,t,omega etc. Hope you can help me. Thx alot and excuse me for english issues.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

m c el 24 de Abr. de 2013
Editada: m c el 24 de Abr. de 2013
Thank you very much, but now is show me only de maximum circle...It's a start, but i want to show on the graphic the value also...Thx again!
and, i think, it's show's me only one of two circle(max or min), not all in same time
##### 3 comentariosMostrar 1 comentario más antiguoOcultar 1 comentario más antiguo
m c el 24 de Abr. de 2013
It's work, but i have two more problems:i need to push the button 4-5 times to show me the entire graphic, at first click it's show me only the max circle....and the secont problem is to align the value on the graphic(i've got 3 diferent axes and for all it show's me the values on the middle one).Thank you very much!
m c el 24 de Abr. de 2013
Editada: m c el 25 de Abr. de 2013
I think i need to write something different at other's two axes because it's show's all values on one graphic .. but i don't see were to modify!

Iniciar sesión para comentar.

### Más respuestas (3)

Mahdi el 24 de Abr. de 2013
MaxValue=max(d);
IndexMaxValue=find(d==MaxValue)
% Creates a red circle where the max is.
plot(handles.axes1, omega.*t(IndexMaxValue), MaxValue, 'ro')
You can follow the same logic for the min value, just use min(d) instead.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

m c el 26 de Abr. de 2013
Editada: m c el 26 de Abr. de 2013
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

m c el 27 de Abr. de 2013
Editada: m c el 27 de Abr. de 2013
Anybody can help me ? I need help!Please! I need to write something on the text code because it show's me all values on the last axes.I find on your site something with parent function but i don't know how to use it.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Categorías

Más información sobre Annotations en Help Center y File Exchange.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by