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

1 Ansicht (letzte 30 Tage)
arunnagiri murrugesan
arunnagiri murrugesan am 16 Okt. 2019
Beantwortet: Rik am 16 Okt. 2019
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

Antworten (1)

Rik
Rik am 16 Okt. 2019
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.

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by