x for y is?

조회 수: 7 (최근 30일)
jop schilder
jop schilder 2020년 2월 24일
댓글: jop schilder 2020년 2월 24일
my data is a table of 17439x3. With the lines being: time, displacement and force, respectively.
I Need all the corresponding values for time and displacement at the peak forces.
my code is
[pks] = findpeaks (-M2B{:,3},'MinPeakProminence',4);
pks = -pks;
idx = find(M2B{:,3} == pks(:,1);
loc = M2B{:,2}(idx);
this does however not work, if i insert pks (1,1) it does work but i dont get it to work for all values. Can anybody help?

채택된 답변

Matt J
Matt J 2020년 2월 24일
[pks,idx] = findpeaks (-M2B{:,3},'MinPeakProminence',4);
pks = -pks;
peak_time=M2B{idx,1};
peak_displacement=M2B{idx,2};
  댓글 수: 1
jop schilder
jop schilder 2020년 2월 24일
Thanks!

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

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