while b < (length(data))
ECG(i,:) = data(f:b);
f = f+477;
b=b+477;
i= i+1;
end

댓글 수: 2

Birdman
Birdman 2018년 1월 11일
What do you try to do? Is this the entire code?
Parsa Paiman
Parsa Paiman 2018년 1월 11일
No, this is not the entire code just a part of it. I am reading a BDF file into Matlab. the outcoming datafile has multiple signals in one column. what I want do do is separate the ECG signal from this file. The ECG signal has 400 data point and then 77 point of other data are beneath it, then comes another 400 points of ECG, etc.

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

 채택된 답변

Star Strider
Star Strider 2018년 1월 11일

0 개 추천

It appears that your code is segmenting your EKG record into 477-element segments.
The reshape (link) function could likely do this in one call. Assuming that ‘data’ is a row vector, try this:
EKG = reshape(data, [], 477);
The length of ‘data’ must be an integer multiple of 477, so check that first, and trim the length if necessary before the reshape call.

댓글 수: 5

Parsa Paiman
Parsa Paiman 2018년 1월 11일
I am reading a BDF file into Matlab. the outcoming datafile has multiple signals in one column. what I want do do is separate the ECG signal from this file. The ECG signal has 400 data point and then 77 point of other data are beneath it, then comes another 400 points of ECG, etc.
Walter Roberson
Walter Roberson 2018년 1월 11일
Star Strider, you forgot for a moment that MATLAB distributes data down columns first, so your approach would not group the 477 entries together. That is why I reshape to 477 by something and then transpose.
Probably the easiest way is to first use rehsape on your column vector, then keep only the first 400 rows:
EKG = reshape(data, 477, []);
EKG = EKG(1:400,:);
You may need to experiment to get the result you want.
Parsa Paiman
Parsa Paiman 2018년 1월 11일
Thanks Star Strider. This is exactly what I wanted.
Star Strider
Star Strider 2018년 1월 11일
As always, my pleasure.

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2018년 1월 11일

0 개 추천

Perhaps
ECG = reshape(data, 477, :).';

댓글 수: 1

Parsa Paiman
Parsa Paiman 2018년 1월 11일
I am reading a BDF file into Matlab. the outcoming datafile has multiple signals in one column. what I want do do is separate the ECG signal from this file. The ECG signal has 400 data point and then 77 point of other data are beneath it, then comes another 400 points of ECG, etc.

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

카테고리

도움말 센터File Exchange에서 ECG / EKG에 대해 자세히 알아보기

질문:

2018년 1월 11일

댓글:

2018년 1월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by