b=abs([b;a(i)-a(i+1)]); error

조회 수: 1 (최근 30일)
arunnagiri murrugesan
arunnagiri murrugesan 2019년 10월 16일
답변: Rik 2019년 10월 16일
a=all_peak(:,1);
b=[ ];
for i= 1:27
b=abs([b;a(i)-a(i+1)]); % getting error here as %
end
win_len=mean(b)+25;
where all_ peak= 27 *2 matrix like 1642 23
1723 -32
1746 28

답변 (1개)

Rik
Rik 2019년 10월 16일
Your loop goes up to 27, and inside the loop you look at i+1. You should let your loop go to numel(a)-1 instead of 27.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by