필터 지우기
필터 지우기

how to deal with this error??

조회 수: 2 (최근 30일)
Good mind
Good mind 2017년 6월 3일
편집: Good mind 2017년 6월 3일
Error using -
Matrix dimensions must agree.
E=ecg-y;
ecg is 2000x1 and y is 1x2000

답변 (1개)

Guillaume
Guillaume 2017년 6월 3일
The fact you're getting an error shows that you're using an older version of matlab. In R2016b and later, there would have been no error (but the result may not have been what you've wanted).
If the result is supposed to be a 2000 x 2000 matrix of the difference of the cartesian pairs from the two vectors:
E = bsxfun(@minus, ecg, y);
This is the result you'd get from newer versions of matlab.
If the result is suppose to be the difference of the two vectors regardless of their shape, then first you need to take a good look at your code and ask why aren't these two vectors both row vectors or both column vectors. The best way to solve your problem would be to change whatever created one of them so they're both the same shape. Alternatively,
E = ecg - y.';
But really fix your algorithm. These vectors should not be in different directions.
  댓글 수: 1
Good mind
Good mind 2017년 6월 3일
편집: Good mind 2017년 6월 3일
y is obtained after wiener filtering of ecg signal

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 ECG / EKG에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by