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