필터 지우기
필터 지우기

How to find maximum value in a plot

조회 수: 2 (최근 30일)
Negar
Negar 2011년 2월 6일
댓글: Oskar Schnippering 2021년 3월 19일
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

채택된 답변

Jan
Jan 2011년 2월 6일
"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
Christian Rasmussen
Christian Rasmussen 2020년 9월 24일
Yes the plot is probably printed on paper
Oskar Schnippering
Oskar Schnippering 2021년 3월 19일
how would you do it if the plot were on a chalkboard ?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by