Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 110064

Submitted on 11 Jul 2012

Incorrect

46Size
Leading solution size is 33.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Fail
 
%% example 1
C = {[1 2 3],[]};
 output = [  1     2     3
               NaN   NaN   NaN];
assert(isequalwithequalnans(your_fcn_name(C),output))
Error: Undefined function 'your_fcn_name' for input arguments of type 'cell'.
2
Fail
 
%% example 2
C = {[1 2 3],8,[],[15  3]};
y_correct = [ 1     2     3
     8   NaN   NaN
   NaN   NaN   NaN
    15     3   NaN];
assert(isequalwithequalnans(your_fcn_name(C),y_correct))
Error: Undefined function 'your_fcn_name' for input arguments of type 'cell'.
3
Fail
 
%%
tcell = {ones(1,4), [1 2 3 4 5], 1:8, 1, [],0};
y_correct = [   1     1     1     1   NaN   NaN   NaN   NaN
     1     2     3     4     5   NaN   NaN   NaN
     1     2     3     4     5     6     7     8
     1   NaN   NaN   NaN   NaN   NaN   NaN   NaN
   NaN   NaN   NaN   NaN   NaN   NaN   NaN   NaN
     0   NaN   NaN   NaN   NaN   NaN   NaN   NaN];
assert(isequalwithequalnans(your_fcn_name(tcell),y_correct))
Error: Undefined function 'your_fcn_name' for input arguments of type 'cell'.
4
Fail
 
%%
C = {[]}
assert(isempty(your_fcn_name(C)))
Error: Undefined function 'your_fcn_name' for input arguments of type 'cell'.