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 260870

Submitted on 13 Jun 2013

Incorrect

20Size
Leading solution size is 18.
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
 
%%
n=5;
[m_out{1:n}] = use_varargout(n)
Pass=true;
for i=1:n
 Pass=Pass && isequal(m_out{i},magic(i));
end
m_out{n}
assert(isequal(Pass,1))
Error: Output argument "varargout{2}" (and maybe others) not assigned during call to "/users/msssystem3/use_varargout.m>use_varargout".
2
Fail
 
%%
n=7;
[m_out{1:n}] = use_varargout(n)
Pass=true;
for i=1:n
 Pass=Pass && isequal(m_out{i},magic(i));
end
m_out{n}
assert(isequal(Pass,1))
Error: Output argument "varargout{2}" (and maybe others) not assigned during call to "/users/msssystem3/use_varargout.m>use_varargout".