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.
b=abs([b;a(i)-a(i+1)]); error
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!