Cody

Problem 45190. remove numbers from a string

Solution 2007910

Submitted on 7 Nov 2019
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
a = 'i2am000jon'; y_correct = 'i am000jon' assert(isequal(str_num(a),y_correct))

y_correct = 'i am000jon' ans = 1×4 cell array {'2'} {'0'} {'0'} {'0'}

Output argument "y" (and maybe others) not assigned during call to "str_num". Error in Test1 (line 3) assert(isequal(str_num(a),y_correct))

2   Fail
a='manhattan' y_correct = 'manhattan' assert(isequal(str_num(a),y_correct))

a = 'manhattan' y_correct = 'manhattan' ans = 0×0 empty cell array

Output argument "y" (and maybe others) not assigned during call to "str_num". Error in Test2 (line 3) assert(isequal(str_num(a),y_correct))

3   Fail
a='man345hatta0n01' y_correct = 'man 45hatta0n01' assert(isequal(str_num(a),y_correct))

a = 'man345hatta0n01' y_correct = 'man 45hatta0n01' ans = 1×6 cell array {'3'} {'4'} {'5'} {'0'} {'0'} {'1'}

Output argument "y" (and maybe others) not assigned during call to "str_num". Error in Test3 (line 3) assert(isequal(str_num(a),y_correct))

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!