Info
この質問は閉じられています。 編集または回答するには再度開いてください。
can anybody tell me the logic of this code
1 回表示 (過去 30 日間)
古いコメントを表示
th=abs(max(y)); th=th/2; c=0; % peaks are seen as pulses(heart beats) for i=1:1:length(y) if y(i)>th qrs(i)=1; c=c+1; i=i+15; else qrs(i)=0; end end
0 件のコメント
回答 (1 件)
Roger Stafford
2014 年 3 月 10 日
This is not good code. The index 'i' of the for-loop is advanced by 15 if y(i)>th is true, apparently expecting to skip the next 14 checks on y. However, this is not what will happen. The for-loop will stubbornly return with 'i' set to the next sequential value after that last one, and do no skipping.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!