Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 96692

Submitted on 7 Jun 2012 by Albert Yam

Correct

72Size
Leading solution size is 31.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
inStr = 'ball';
strList = {'ball', 'bell', 'barn'};
assert(isequal(findMatch(inStr, strList), 'ball'));

                    
2
Pass
 
%%
inStr = 'auG';
strList = {'May', 'June', 'July', 'August', 'September'};
assert(isequal(findMatch(inStr, strList), 'August'));

                    
3
Pass
 
%%
inStr = 'Ju';
strList = {'May', 'June', 'July', 'August', 'September'};
assert(isequal(findMatch(inStr, strList), ''));

                    
4
Pass
 
%%
inStr = 'fontn';
strList = {'FontName', 'FontUnits', 'FontSize', 'FontWeight'};
assert(isequal(findMatch(inStr, strList), 'FontName'));

                    
5
Pass
 
%%
inStr = 'weight';
strList = {'FontName', 'FontUnits', 'FontSize', 'FontWeight'};
assert(isequal(findMatch(inStr, strList), 'FontWeight'));

                    
6
Pass
 
%%
inStr = 'ball';
strList = {'baseball', 'balloon', 'ball'};
assert(isequal(findMatch(inStr, strList), 'ball'));

                    
7
Pass
 
%%
inStr = 'bal';
strList = {'baseball', 'balloon', 'ball'};
assert(isequal(findMatch(inStr, strList), ''));