b@0: function saveMultiComp(hf) % called from 'endmultiComp' or whenever temporarily saved b@0: b@0: dat=get(hf,'userdata'); b@0: b@0: test=dat.test; b@0: b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: % Collect the results into rsl b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: b@0: rsl.gcom=strrep(get(dat.gcom,'string'), sprintf('\n'),'; '); % general comments b@0: rsl.hcom=get(struct([]), 'struct'); % empty array of individual comments b@0: rsl.permVec=dat.permVec; b@0: rsl.playVec=dat.playVec; b@0: b@0: nbSnd=test.nbComb; b@0: nbScale=length(test.scale); b@0: b@0: for noScale=1:nbScale b@0: for noSnd=1:nbSnd b@0: rsl.hcom{noSnd}=strrep(get(dat.hcom{noSnd}, 'string'), sprintf('\n'),'; '); % individual comments b@0: posIc=get(dat.hIcon(noScale,noSnd),'position'); b@0: scale=test.scale(noScale); b@0: posx=posIc(1); b@0: dxx=dat.dxx; b@0: dxI=dat.dxI; b@0: minx=scale.minn; b@0: maxx=scale.maxx; b@0: stepp=scale.stepp; b@0: a=(maxx-minx)/(1-2*dxx); b@0: b=minx-a*dxx; b@0: nx=a*(posx+dxI/2)+b; b@0: rsl.mat(noScale,noSnd)=nx; b@0: end b@0: end b@0: b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: % Save it b@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% b@0: b@0: test=[]; b@0: indDat=[]; b@0: sesDat=dat.sesDat; b@0: b@0: test.rsl=rsl; b@0: test.tstFile=sesDat.tstDat{dat.sesDat.noTst}.tstFile; b@0: test.tstType=sesDat.tstDat{dat.sesDat.noTst}.tstType; b@0: test.sndFile=sesDat.cuSndListFile; b@0: b@0: % Create new test data file b@0: sesDat.tstDat{dat.sesDat.noTst}=test; b@0: b@0: % make temporary variable in workspace b@0: assignin('base','multiComp',test); b@0: b@0: % save the individual session b@0: indDat.id=sesDat.id; b@0: indDat.sesScript=sesDat.sesScript; b@0: indDat.tstDat=sesDat.tstDat; b@0: eval(sprintf('%s=indDat;',indDat.id)); b@0: expre=sprintf('save(''responses/%s'',''%s'')',indDat.id,indDat.id); b@0: eval(expre);