Cody

# Problem 407. Back to basics 17 - white space

Solution 2090666

Submitted on 13 Jan 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
x = 'MATLAB '; y_correct = 'MATLAB'; assert(isequal(white_space_removal(x),y_correct))

Brace indexing is not supported for variables of this type. Error in white_space_removal (line 3) ind = find(x{ii}~=' ',1, 'last'); Error in Test1 (line 3) assert(isequal(white_space_removal(x),y_correct))

2   Fail
x{1,1} = 'MATLAB '; x{1,2} = 'SIMULINK '; x{2,1} = 'Toolboxes '; x{2,2} = 'MathWorks '; y{1,1} = 'MATLAB'; y{1,2} = 'SIMULINK'; y{2,1} = 'Toolboxes'; y{2,2} = 'MathWorks'; assert(isequal(white_space_removal(x),y))

Assertion failed.

3   Fail
NL = char(0); TAB = char(9); x = [NL 32 TAB NL 'AB' 32 NL 'CD' NL 32 TAB NL 32]; y = [NL 32 TAB NL 'AB' 32 NL 'CD']; assert(isequal(white_space_removal(x),y))

Brace indexing is not supported for variables of this type. Error in white_space_removal (line 3) ind = find(x{ii}~=' ',1, 'last'); Error in Test3 (line 5) assert(isequal(white_space_removal(x),y))