필터 지우기
필터 지우기

how do i find the matching data for locs when using findpeaks()

조회 수: 5 (최근 30일)
chengwei zhang
chengwei zhang 2020년 2월 5일
댓글: chengwei zhang 2020년 2월 5일
Hi
I am using the function
[pks,locs]=findpeaks()
and the locs returns the position of that pks in the data when plotting
but what I want is plotting the pks and the other coloum in the data not the locs as the x-axis
thanks in advance
  댓글 수: 2
KSSV
KSSV 2020년 2월 5일
What do you mean by plotting the pks and the other coloum in the data?
chengwei zhang
chengwei zhang 2020년 2월 5일
in the CeramicRe.txt, there are two coloums of data, the one on the right side is the pks and the left side is time, but the code i used only return the pks with its position number in the data but i want to plot the pks vs. time

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

채택된 답변

Adam Danz
Adam Danz 2020년 2월 5일
편집: Adam Danz 2020년 2월 5일
If your peaks plot is produced by
plot(time, data)
and you're locating the peaks with
[pks,locs]=findpeaks(data);
Then, to plot the peaks as a function of time,
plot(time(locs), pks, '*')

추가 답변 (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