0001 function ichoice = demodStartIndexFinder( x )
0002
0003
0004
0005 imax = 10;
0006 istart = 1;
0007
0008 while istart<imax
0009 i = istart;
0010 j = 1;
0011 while i<( length( x )-imax )
0012 y( j ) = x( i );
0013 y( j+1 ) = x( i+1 );
0014 y( j+2 ) = x( i+2 );
0015 y( j+3 ) = x( i+3 );
0016 i = i + imax;
0017 j = j + 4;
0018 end
0019
0020 score( istart ) = sum( y );
0021 ival( istart ) = istart;
0022 istart = istart + 1;
0023 end
0024
0025 [ maxScore,maxScoreIndex ] = max( score );
0026 ichoice = ival(maxScoreIndex);
0027 end