6 %
Copyright 2010 (
C) 2010 by Eberhard Gamm <eberhard.gamm@gmx.de>
7 % Published under GNU General Public License (GPL V2). No warranty at all.
9 function dataSet = loadQucsDataSet(dataSetFile)
13 fid = fopen(dataSetFile,
'r');
15 fprintf(1,
'Data set %s not found\n',dataSetFile);
22 while ~feof(
fid) && ~error
32 if strcmp(line(1:min(7,ll)),'<indep ')
33 [name,len,cnt] = sscanf(line(8:end-1),'%
s %d','
C');
41 dataSet(idx).name = name;
42 dataSet(idx).nameDep = '-';
44 dataSet(idx).
data = zeros(1,10000);
47 if strcmp(line(1:min(5,ll)),'<dep ')
48 [name,nameDep,cnt] = sscanf(line(6:end-1),'%
s %
s','C');
50 fprintf(1,'Invalid dependent
variable in
data set %s\n',dataSetFile);
55 dataSet(idx).name = name;
56 dataSet(idx).nameDep = nameDep;
58 dataSet(idx).
data = zeros(1,10000);
61 if strcmp(line(1:min(8,ll)),'</indep>') || strcmp(line(1:min(6,ll)),'</dep>')
62 dataSet(idx).
data = dataSet(idx).
data(1:idata-1);
63 dataSet(idx).len = idata - 1;
68 [val,cnt] = sscanf(line,'%f');
70 fprintf(1,'Invalid
data in
data set %s\n',dataSetFile);
74 if idata > length(dataSet(idx).
data)
75 dataSet(idx).
data = [dataSet(idx).
data zeros(1,10000)];
77 dataSet(idx).
data(idata) = val;