File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
+types/+untyped/+datastub Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 4848 rangeMatches = ismembc(idealRange , indices );
4949 startInd = find(rangeMatches , 1 );
5050 stopInd = find(rangeMatches , 1 , ' last' );
51- if ~all(rangeMatches(startInd : stopInd ))
52- stopInd = find(~rangeMatches(startInd : stopInd ), 1 ) - 1 ;
51+ splitPoints = find(~rangeMatches(startInd : stopInd )) + startInd - 1 ;
52+ if ~isempty(splitPoints )
53+ subStarts = [startInd (splitPoints + 1 )];
54+ subStops = [(splitPoints - 1 ) stopInd ];
55+ [~ , largestSegInd ] = max(subStops - subStarts + 1 , [], ' linear' );
56+ startInd = subStarts(largestSegInd );
57+ stopInd = subStops(largestSegInd );
5358 end
5459 subCount = sum(rangeMatches(startInd : stopInd ));
5560 if subCount > count
56- start = indices (startInd );
57- stop = indices (stopInd );
61+ start = idealRange (startInd );
62+ stop = idealRange (stopInd );
5863 step = tempStep ;
5964 count = subCount ;
6065 end
You can’t perform that action at this time.
0 commit comments