Problem 42592. Create cell array of strings

Solution 1190798

Submitted on 16 May 2017 by Thomas Bischoff
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   Pass
S = 'Testing, testing, 1, 2, 3'; assert(isequal(str2cell(S),{S}))

2   Pass
S = {'I','love','MATLAB'}; assert(isequal(str2cell(S),S))

3   Pass
S = datestr(now); assert(isequal(str2cell(S),{S}))

4   Pass
for ii=1:100 S = char(randi([97,122],1,100)); assert(isequal(str2cell(S),{S})) end

5   Pass
for ii=1:100 S = num2cell(char(randi([97,122],100,1))); assert(isequal(str2cell(S),S)) end

Suggested Problems

More from this Author44

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!