Cody

# Problem 42810. String Find with Wildcards of a Cell array

Solution 2525106

Submitted on 12 Jun 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
c={'abcdef' '12345' 'matfile.mat' 'fname.xls'}; str='*.xls'; assert(isequal(stridx(c,str),[4]))

c_fidx = 1×4 logical array 0 0 0 1

Assertion failed.

2   Fail
c={'abcdef' '12345' 'matfile.mat' 'fname.xls'}; str='xls'; assert(isequal(stridx(c,str),[4]))

c_fidx = 1×4 logical array 0 0 0 1

Assertion failed.

3   Fail
c={'abcdef' '12345' 'matfile.mat' 'abcfname.xls'}; str='a*f'; assert(isequal(stridx(c,str),[1 3 4]))

c_fidx = 1×4 logical array 1 0 1 1 c_fidx = 1×4 logical array 1 0 1 1

Assertion failed.

4   Fail
c={'abcdef' '12345' 'matfile.mat' 'abcfname.xls'}; str='a?f'; assert(isequal(stridx(c,str),[3]))

c_fidx = 1×4 logical array 0 0 0 0

Assertion failed.

5   Fail
c={'abcdef' '12345' 'matfile.mat' 'abcfname.xls'}; str='1*5'; assert(isequal(stridx(c,str),[2]))

c_fidx = 1×4 logical array 0 1 0 0 c_fidx = 1×4 logical array 0 1 0 0

Assertion failed.

6   Fail
c={'random' 'test.mart' 'rat' 'matfile.mat' 'random.mat' 'matfile'}; str='.ma*t'; assert(isequal(stridx(c,str),[2 4 5]))

c_fidx = 1×6 logical array 0 1 0 1 1 0 c_fidx = 1×6 logical array 0 1 1 1 1 1

Assertion failed.