필터 지우기
필터 지우기

How do I record 2 peak values pass a specific number on the X axis?

조회 수: 2 (최근 30일)
AJ516
AJ516 2017년 7월 19일
답변: Lipi 2017년 7월 19일
I attached a .fig file to help describe the data(PeakValues.fig, but if the attachment is missing, someone let me know.). Download the file to see the data.
There are three peaks recorded in the data above 4 on the Y-axis. However, I would like to record only the two peaks past 300 on the X-axis. I would like to record both x and y values of the two peaks and assign each x and y to a variable for finding the midpoint(ex. x1,y1 and x2,y2). What codes would be recommended to record the max values of two peaks if I only want the peaks pass 300?

채택된 답변

Lipi
Lipi 2017년 7월 19일
I understand that you want to record the peaks past 300. In that case you could limit your data to values past 300. For example if data is stored in variable called ‘data’, you could use something like:
[pks,locs] = findpeaks(data(300:end))
Where the 'pks' variable would contain your y1 and y2 values and 'locs' would have x1 and x2, which would record the max values of only two peaks.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by