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 69116

Submitted on 2 Apr 2012 by AMITAVA BISWAS

Correct

23Size
Leading solution size is 12.
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
Pass
 
%%
x = 1:10;
[a,b,c,d] = doubleDeal(x);
y_correct = 1:4;
assert(isequal([a b c d],y_correct))

                    
2
Pass
 
%%
x = randn(1,1000);
y = cell(1,1000);
[y{:}] = doubleDeal(x);
y_correct = x;
assert(isequal([y{:}],y_correct))