b@0
|
1 function saveMultiComp(hf) % called from 'endmultiComp' or whenever temporarily saved
|
b@0
|
2
|
b@0
|
3 dat=get(hf,'userdata');
|
b@0
|
4
|
b@0
|
5 test=dat.test;
|
b@0
|
6
|
b@0
|
7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
b@0
|
8 % Collect the results into rsl
|
b@0
|
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
b@0
|
10
|
b@0
|
11 rsl.gcom=strrep(get(dat.gcom,'string'), sprintf('\n'),'; '); % general comments
|
b@0
|
12 rsl.hcom=get(struct([]), 'struct'); % empty array of individual comments
|
b@0
|
13 rsl.permVec=dat.permVec;
|
b@0
|
14 rsl.playVec=dat.playVec;
|
b@0
|
15
|
b@0
|
16 nbSnd=test.nbComb;
|
b@0
|
17 nbScale=length(test.scale);
|
b@0
|
18
|
b@0
|
19 for noScale=1:nbScale
|
b@0
|
20 for noSnd=1:nbSnd
|
b@0
|
21 rsl.hcom{noSnd}=strrep(get(dat.hcom{noSnd}, 'string'), sprintf('\n'),'; '); % individual comments
|
b@0
|
22 posIc=get(dat.hIcon(noScale,noSnd),'position');
|
b@0
|
23 scale=test.scale(noScale);
|
b@0
|
24 posx=posIc(1);
|
b@0
|
25 dxx=dat.dxx;
|
b@0
|
26 dxI=dat.dxI;
|
b@0
|
27 minx=scale.minn;
|
b@0
|
28 maxx=scale.maxx;
|
b@0
|
29 stepp=scale.stepp;
|
b@0
|
30 a=(maxx-minx)/(1-2*dxx);
|
b@0
|
31 b=minx-a*dxx;
|
b@0
|
32 nx=a*(posx+dxI/2)+b;
|
b@0
|
33 rsl.mat(noScale,noSnd)=nx;
|
b@0
|
34 end
|
b@0
|
35 end
|
b@0
|
36
|
b@0
|
37 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
b@0
|
38 % Save it
|
b@0
|
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
b@0
|
40
|
b@0
|
41 test=[];
|
b@0
|
42 indDat=[];
|
b@0
|
43 sesDat=dat.sesDat;
|
b@0
|
44
|
b@0
|
45 test.rsl=rsl;
|
b@0
|
46 test.tstFile=sesDat.tstDat{dat.sesDat.noTst}.tstFile;
|
b@0
|
47 test.tstType=sesDat.tstDat{dat.sesDat.noTst}.tstType;
|
b@0
|
48 test.sndFile=sesDat.cuSndListFile;
|
b@0
|
49
|
b@0
|
50 % Create new test data file
|
b@0
|
51 sesDat.tstDat{dat.sesDat.noTst}=test;
|
b@0
|
52
|
b@0
|
53 % make temporary variable in workspace
|
b@0
|
54 assignin('base','multiComp',test);
|
b@0
|
55
|
b@0
|
56 % save the individual session
|
b@0
|
57 indDat.id=sesDat.id;
|
b@0
|
58 indDat.sesScript=sesDat.sesScript;
|
b@0
|
59 indDat.tstDat=sesDat.tstDat;
|
b@0
|
60 eval(sprintf('%s=indDat;',indDat.id));
|
b@0
|
61 expre=sprintf('save(''responses/%s'',''%s'')',indDat.id,indDat.id);
|
b@0
|
62 eval(expre);
|