Home > src > describeVariables.m

describeVariables

PURPOSE ^

This function tells you which variables are best in an easy to understand format

SYNOPSIS ^

function describeVariables( varParams, bestIdx )

DESCRIPTION ^

 This function tells you which variables are best in an easy to understand format
 Samuel Rivera
 Jul 20, 2011
 syntax: describeVariables( varParams, bestIdx )
 
 Inputs:
 varParams: the struct returnd by extractVarsDist ( when you extracted
   variables)
 bestIdx: a vector of the best indices as determined by the sortVariable**
   functions.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % This function tells you which variables are best in an easy to understand format
0002 % Samuel Rivera
0003 % Jul 20, 2011
0004 % syntax: describeVariables( varParams, bestIdx )
0005 %
0006 % Inputs:
0007 % varParams: the struct returnd by extractVarsDist ( when you extracted
0008 %   variables)
0009 % bestIdx: a vector of the best indices as determined by the sortVariable**
0010 %   functions.
0011 %
0012 function describeVariables( varParams, bestIdx )
0013 
0014 
0015 
0016 numAOIs = varParams.dimPerFeat(1);  % var 1 is AOI fix density
0017 % % numRelAOIs = varParams.dimPerFeat(5)/varParams.numHistBins;% var 5 is hist bins
0018 % % numBins = varParams.numHistBins;
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     % find exact variable within the variable type ( ie, 2nd fixation density)
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     %output very nicely which variable
0043     if strcmp( varParams.dimNames{whereItIs(i1)}, 'AOIFixationSeq' ) %fixation sequence
0044         whichPos = mod( subWhereItIs(i1), numAOIs);
0045         if whichPos == 0; whichPos =numAOIs; end
0046         whichFix = ceil( subWhereItIs(i1)/numAOIs );
0047         fprintf( 'Var %d is Fix %d at AOI %d \n', i1, whichFix, whichPos);    
0048     
0049     elseif strcmp( varParams.dimNames{whereItIs(i1)}, 'AOISaccadeSeq' )
0050         whichPos = mod( subWhereItIs(i1), numAOIs);
0051         if whichPos == 0; whichPos =numAOIs; end
0052         whichFix = ceil( subWhereItIs(i1)/numAOIs );
0053         fprintf( 'Var %d is Sac %d to AOI %d \n', i1, whichFix, whichPos);      
0054         
0055 % %    elseif strcmp( varParams.dimNames{whereItIs(i1)}, 'AOIFixationDistHistogram' )
0056 % %         whichPos = mod( subWhereItIs(i1), numBins);
0057 % %         if whichPos == 0; whichPos =numBins; end
0058 % %         whichAOI = ceil( subWhereItIs(i1)/numBins );
0059 % %         fprintf( 'Var %d is rel AOI %d, DHB %d \n', i1, whichAOI, whichPos);
0060 % %
0061         
0062     elseif strcmp( varParams.dimNames{whereItIs(i1)}, 'relNonRelFixSeq' )  
0063         target = 'relevant';
0064         whichPos = mod( subWhereItIs(i1), 2);
0065         if whichPos == 0; target = 'non-relevant'; end
0066         whichFix = ceil( subWhereItIs(i1)/2 );
0067         fprintf( 'Var %d is Fix %d at %s AOI \n', i1, whichFix, target);          
0068  
0069                 
0070     elseif strcmp( varParams.dimNames{whereItIs(i1)}, 'relNonRelSacSeq' )  
0071         target = 'relevant';
0072         whichPos = mod( subWhereItIs(i1), 2);
0073         if whichPos == 0; target = 'non-relevant'; end
0074         whichFix = ceil( subWhereItIs(i1)/2 );
0075         fprintf( 'Var %d is Sac %d to %s AOI \n', i1, whichFix, target);     
0076         
0077     else % default output
0078         fprintf( 'Var %d is feat %d of %s\n', i1, subWhereItIs(i1), ...
0079                 varParams.dimNames{whereItIs(i1)});        
0080     end
0081     
0082 end
0083 
0084 
0085 
0086 
0087

Generated on Wed 20-Jan-2016 11:50:43 by m2html © 2005