b@0: function testDat=readTestFile(testFile) b@0: fid=fopen(testFile,'r'); b@0: testDat.sndRef=[]; b@0: b@0: b@0: while ~feof(fid) b@0: lin=fgetl(fid); b@0: [word1,COUNT,ERRMSG,NEXTINDEX] = sscanf(lin,'%s',1); b@0: b@0: if (~COUNT | ~strcmp(word1,'%')) b@0: b@0: switch upper(word1) b@0: b@0: case 'NAME' b@0: testDat.name=fgetl(fid); b@0: b@0: case 'COMBINATIONS:' b@0: [nbComb,COUNT,ERRMSG,NEXTINDEX] = sscanf(lin(NEXTINDEX:end),'%d',1); b@0: testDat.nbComb=nbComb; %% b@0: testDat.posComb=[]; b@0: b@0: for noComb=1:nbComb b@0: lin=fgetl(fid); b@0: if ~isempty(lin) b@0: if lin(1)~='%' b@0: [comb,COUNT,ERRMSG,NEXTINDEX] = sscanf(lin,'%d',2); b@0: testDat.comb(noComb,:)=comb; %% b@0: b@0: % Read the reference DATAS b@0: if COUNT==1 b@0: lin=lin(NEXTINDEX:end); b@0: [stri,COUNT,ERRMSG,NEXTINDEX] = sscanf(lin,'%s',1); b@0: b@0: if findstr(lower(stri),'ref') b@0: testDat.sndRef(end+1)=comb(1); b@0: lin=lin(NEXTINDEX:end); b@0: [stri,COUNT,ERRMSG,NEXTINDEX] = sscanf(lin,'%s',1); b@0: end b@0: b@0: if findstr(lower(stri),'pos') b@0: lin=lin(NEXTINDEX:end); b@0: end b@0: b@0: % read the sounds default position b@0: [posComb,COUNT,ERRMSG,NEXTINDEX] = sscanf(lin,'%f',inf); % position must be specified for each scale!! b@0: if ~isempty(posComb) b@0: testDat.posComb(noComb,:)=posComb'; b@0: end b@0: end b@0: end b@0: end b@0: end b@0: % tricky here! try to satisfy both comp1d and 2d b@0: % requirements of default position of icons b@0: % may be should decompose each case... b@0: b@0: posComb=testDat.posComb; b@0: [nbComb1,nbPos]=size(posComb); b@0: if isempty(nbComb1) b@0: nbComb1=1; b@0: end b@0: if exist('nbScale') b@0: nbPos=nbScale; b@0: end b@0: if nbComb1