Borrar filtros
Borrar filtros

How to find maximum value in a plot

4 visualizaciones (últimos 30 días)
Negar
Negar el 6 de Feb. de 2011
Comentada: Oskar Schnippering el 19 de Mzo. de 2021
Hi everybody,
I have a 'voltage vs time' plot, and need to find out the time which the maximum voltage is obtained, and also the value of maximum voltage...
I'd be grateful for the answer

Respuesta aceptada

Jan
Jan el 6 de Feb. de 2011
"I have a plot" does not explain, in which format this "plot" is. Printed on paper? As .fig file? In a PDF? In the current figure?
Let's assume, that the plot is the GCA and it contains one line only:
LineH = get(gca, 'children');
Value = get(LineH, 'YData');
Time = get(LineH, 'XData);
[maxValue, maxIndex] = max(Value);
maxTime = Time(maxIndex);
If your plot is available in another form, please specify it exactly. Be aware, that the above method replies one value only, even if the maximum value appears several times in the data.
  2 comentarios
Christian Rasmussen
Christian Rasmussen el 24 de Sept. de 2020
Yes the plot is probably printed on paper
Oskar Schnippering
Oskar Schnippering el 19 de Mzo. de 2021
how would you do it if the plot were on a chalkboard ?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Spectral Measurements 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