Unable to perform assignment because the left and right sides have a different number of elements.
2 次查看(过去 30 天)
显示 更早的评论
I am calculating first and second derivative for getting threshold values for ecg. but getting error. Please help.
for n=5:numel(ecgBR)
ecg_dif(n)=abs(ecgBR(n,1)-ecgBR(n-2,1));
ecg_dif2(n,1)=abs(ecgBR(n,1)-2*ecgBR(n-2,1)+ecgBR(n-4,1));
end
ERROR:Unable to perform assignment because the left and right sides have a different number of elements.
ecgBR=1X3600 double matrix
0 个评论
采纳的回答
Image Analyst
2020-9-12
Since ecgBR has only one row, not n, you cannot do ecgBR(n, 1), which is the nth row in column 1. But you have 3600 columns, not 1, and 1 row, not 3600. Get rid of the ,1:
for n=5:numel(ecgBR)
ecg_dif(n)=abs(ecgBR(n)-ecgBR(n-2));
ecg_dif2(n)=abs(ecgBR(n)-2*ecgBR(n-2)+ecgBR(n-4));
end
2 个评论
Image Analyst
2020-9-13
Try to understand what the numerical parameters mean, and adjust them to values that work for your signal.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!