Finding two minimum Values in a graph?
조회 수: 10 (최근 30일)
이전 댓글 표시
Hi, I am trying to find two points on the graph, I've searched around but could not find anything specific relating to what I am searching, I am trying to find two X values on the graph of both signals at both points when they're at the lowest in respect to yaxis, I have been trying to generate a code for one, this is what I got so far. Thanks in advance..

indexmin = find(min(laserC) == laserC);
xmin = T(indexmin)
ymin = laserC(indexmin)
indexmax = find(max(laserC) == laserC);
xmax = T(indexmax)
ymax = laserC(indexmax)
output:
xmin =
27.2940
27.3860
ymin =
1.0195
1.0195
But I would like also know how to determine the other xmin value which would be around 30ish.
댓글 수: 0
답변 (1개)
Star Strider
2017년 5월 1일
편집: Star Strider
2017년 5월 1일
Use the Signal Processing Toolbox findpeaks function with the negative of laserC’:
[pks,pkt] = findpeaks(-laserC, T);
pks = -pks; % Correct Amplitudes
The times ‘pkt’ do not need to be corrected.
See the documentation on findpeaks for all the details.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!