Cody

# Problem 1973. Reassign cell contents to empty variables, preserving cell content data type

Solution 374469

Submitted on 24 Dec 2013
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 = {1}; D_correct = {[]}; assert(isequal(resetCell(C), D_correct))

Error: The CLASS function must be called from a class constructor.

2   Fail
%% C = {1, 2; zeros(2, 'single'), 'ABC'}; D_correct = { [], []; zeros(0, 'single'), '' }; assert(isequal(resetCell(C), D_correct))

Error: The CLASS function must be called from a class constructor.

3   Fail
%% C = {true, rand(2), 'MATLAB'}; D_correct = {true(0), [], ''}; assert(isequal(resetCell(C), D_correct))

Error: The CLASS function must be called from a class constructor.

4   Fail
%% C = {1, 2, 'ABC'; true, struct('A', 1), {0}}; D_correct = {[], [], ''; true(0), struct([]), {}}; assert(isequal(resetCell(C), D_correct))

Error: The CLASS function must be called from a class constructor.

5   Fail
%% C = {1, single(3), @sin}; D_correct = {[], single([]), function_handle.empty}; assert(isequal(resetCell(C), D_correct))

Error: The CLASS function must be called from a class constructor.

6   Fail
%% C = {uint8(1), zeros(2, 'int16'), []}; D_correct = {zeros(0, 'uint8'), zeros(0, 'int16'), []}; assert(isequal(resetCell(C), D_correct))

Error: The CLASS function must be called from a class constructor.