Skip to content

Commit

Permalink
Merge pull request #29 from openep/hotfix/v1.0.02
Browse files Browse the repository at this point in the history
Hotfix/v1.0.02
  • Loading branch information
drsewilliams authored Mar 8, 2021
2 parents 8c42b86 + 471f5d4 commit 3453cbd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions read_ecgfile_v4.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,19 @@
indTempChName = indTempChName+1;
i = i+1;
else
tempChName{indTempChName+1} = [names{i} ' ' names{i+1} ' ' names{i+2}];
% look onwards from i to find a string part which ends in a ')'
j = 0;
nextStrPart = names{i+j};
concatStr = names{i};
while ~strcmpi(nextStrPart(end), ')')
j = j + 1;
nextStrPart = names{i+j};
concatStr = [concatStr ' ' nextStrPart];
end
tempChName{indTempChName+1} = concatStr;
%tempChName{indTempChName+1} = [names{i} ' ' names{i+1} ' ' names{i+2}];
indTempChName = indTempChName+1;
i = i+3;
i = i+j+1;
end
end
names = tempChName;
Expand All @@ -109,7 +119,7 @@

% the rest is the voltages
voltages = sscanf(vData, '%d');
if numel(voltages) ~= nChannels*2500;
if numel(voltages) ~= nChannels*2500
error('READ_ECGFILE: Unexpected size of voltage data.')
end
voltages = chGain * reshape(voltages, nChannels, 2500)';
Expand All @@ -132,7 +142,7 @@

if nargout == 1
varargout{1} = voltages;
elseif nargout == 2;
elseif nargout == 2
varargout{1} = names;
varargout{2} = voltages;
else
Expand Down
2 changes: 1 addition & 1 deletion read_ecgfile_v4_header.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
temp = find(iCh); iChSecond = temp(2);
temp = find(iRf); iRfFirst = temp(1);
iNeeded = iChSecond+1 : 1 : iRfFirst-1;
if strcmpi(tokens(iNeeded(1)), 'MC')
if strstartcmpi(tokens(iNeeded(1)), 'MC')
separator = ' ';
else
separator = '-';
Expand Down

0 comments on commit 3453cbd

Please sign in to comment.