-
Notifications
You must be signed in to change notification settings - Fork 9
/
cardio_readucc.m
60 lines (47 loc) · 1.18 KB
/
cardio_readucc.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
% ñ÷èòûâàíèå ôàéëîâ *ucc.* (ðåøåíèå çàäà÷è CardioQVARK - Äüÿêîíîâ Àëåêñàíäð, ÂÌÊ ÌÃÓ)
% F - ïðèçíàêè
% X - ãëàâíàÿ âîëíà
function [F, X] = cardio_readucc(filename)
F = zeros([1 7]); % ïðèçíàêè
X = zeros([1 710]); % ïðèçíàêè
disp(sprintf('fileucc=%s', filename))
ffile = fopen (filename);
s = fgetl(ffile);
while(~isempty(s))
j = find(s==',');
name = s(1:j-1);
val = str2num(s(j+1:end));
switch name
case 'error'
F(1) = val;
case 'quality'
F(2) = val;
case 'spqrst'
F(3) = val;
case 'spq'
F(4) = val;
case 'sqrs'
F(5) = val;
case 'sst'
F(6) = val;
otherwise
disp(sprintf('%s,%g', name, val));
end
%disp(sprintf('%s,%g', name, val));
if (strcmp(name,'error')&&(val<0))
return
end
s = fgetl(ffile);
end
% ñ÷èòûâàíèå âîëíû
s = fgetl(ffile);
t=0;
while(~isempty(s)&&(ischar(s))) % +óñëîâèå âûõîäà?
t = t+1;
% disp(s);
X(t) = str2num(s);
s = fgetl(ffile);
end;
% X = X(1:t);
F(7) = t; % äëèíà âîëíû
fclose (ffile);