0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 function findVarForBestIdx( varParams, bestIdx )
0013
0014
0015
0016 numAOIs = varParams.dimPerFeat(1);
0017
0018
0019
0020 clear x whereItIs
0021 numBest = length( bestIdx );
0022 numVariableTypes = length( varParams.dimPerFeat);
0023
0024 for i1 = 1:numVariableTypes
0025 x(i1) = sum(varParams.dimPerFeat(1:i1));
0026 end
0027
0028 whereItIs = zeros( numBest,1);
0029 for i1 = 1:numBest
0030 temp = find( bestIdx(i1) <= x );
0031 whereItIs(i1) = temp(1);
0032 end
0033
0034 for i1 = 1:numBest
0035
0036 if whereItIs(i1) > 1
0037 subWhereItIs(i1) = bestIdx(i1) - x( whereItIs(i1) -1);
0038 else
0039 subWhereItIs(i1) = bestIdx(i1);
0040 end
0041
0042
0043
0044
0045
0046
0047 if strcmp( varParams.dimNames{whereItIs(i1)}, 'AOIFixationSeq' )
0048 whichPos = mod( subWhereItIs(i1), numAOIs);
0049 if whichPos == 0; whichPos =numAOIs; end
0050 whichFix = ceil( subWhereItIs(i1)/numAOIs );
0051 fprintf( 'Var %d is Fix %d at AOI %d \n', i1, whichFix, whichPos);
0052
0053 elseif strcmp( varParams.dimNames{whereItIs(i1)}, 'AOISaccadeSeq' )
0054 whichPos = mod( subWhereItIs(i1), numAOIs);
0055 if whichPos == 0; whichPos =numAOIs; end
0056 whichFix = ceil( subWhereItIs(i1)/numAOIs );
0057 fprintf( 'Var %d is Sac %d to AOI %d \n', i1, whichFix, whichPos);
0058
0059
0060
0061
0062
0063
0064
0065
0066 elseif strcmp( varParams.dimNames{whereItIs(i1)}, 'relNonRelFixSeq' )
0067 target = 'relevant';
0068 whichPos = mod( subWhereItIs(i1), 2);
0069 if whichPos == 0; target = 'non-relevant'; end
0070 whichFix = ceil( subWhereItIs(i1)/2 );
0071 fprintf( 'Var %d is Fix %d at %s AOI \n', i1, whichFix, target);
0072
0073
0074 elseif strcmp( varParams.dimNames{whereItIs(i1)}, 'relNonRelSacSeq' )
0075 target = 'relevant';
0076 whichPos = mod( subWhereItIs(i1), 2);
0077 if whichPos == 0; target = 'non-relevant'; end
0078 whichFix = ceil( subWhereItIs(i1)/2 );
0079 fprintf( 'Var %d is Sac %d to %s AOI \n', i1, whichFix, target);
0080
0081 else
0082 fprintf( 'Var %d is var %d of %s\n', i1, subWhereItIs(i1), ...
0083 varParams.dimNames{whereItIs(i1)});
0084 end
0085
0086 end
0087
0088
0089
0090
0091