Peak alignment from matrix of curves

조회 수: 5 (최근 30일)
Samuel Tomp
Samuel Tomp 2019년 2월 26일
댓글: Star Strider 2019년 2월 26일
Hi, I'm working on a project that needs me to align and average multiple curves into a single curve. Right now I have a 150x4 matrix that gives the graph:
I need to shift the graphs so that all of their peaks line up but I'm not sure how I should do it. Here is also the relevant code:
Stress_min = islocalmin(Stress_smooth, 'MinProminence', prominence);
figure;
plot(time, Stress_smooth, time(Stress_min), Stress_smooth(Stress_min), 'r*')
mins_locs = ceil(time(Stress_min) * 30);
num_min = length(mins_locs)-1;
for i = 1:num_min
Stress_smooth_curves = Stress_smooth(mins_locs(i):mins_locs(i+1));
Stress_curves(1:length(Stress_smooth_curves), i) = Stress_smooth_curves;
end
figure;
plot(Stress_curves);

채택된 답변

Star Strider
Star Strider 2019년 2월 26일
See if the alignsignals (link) function will provide the result you need. Choose one signal and align the rest of them to it.
  댓글 수: 5
Samuel Tomp
Samuel Tomp 2019년 2월 26일
That worked perfectly thank you!
Star Strider
Star Strider 2019년 2월 26일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by