Cody

Problem 380. Convert a numerical matrix into a cell array of strings

Solution 2794993

Submitted on 6 Aug 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
input = 1:3; output = {'1' '2' '3'}; assert(isequal(matrix2cell(input ),output)) assert(iscell(output),'output must be a cell')

Error in solution: Line: 2 Column: 19 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.

2   Fail
input = 0:5:8 output = {'0' '5'}; assert(isequal(matrix2cell(input ),output)) assert(iscell(output),'output must be a cell')

Error in solution: Line: 2 Column: 19 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.

3   Fail
input =magic(3); output = {'8' '1' '6' '3' '5' '7' '4' '9' '2'} assert(isequal(matrix2cell(input ),output))

Error in solution: Line: 2 Column: 19 Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality, use '=='.