Cody

Problem 43147. Basic commands - amount of inputs

Solution 1918172

Submitted on 1 Sep 2019
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
y_correct = 3; assert(isequal(amountinput(1,2,3),y_correct))

Attempt to execute SCRIPT varargin as a function: /opt/mlsedu/matlab/R2019a/toolbox/matlab/lang/varargin.m Error in amountinput (line 2) y=varargin Error in Test1 (line 2) assert(isequal(amountinput(1,2,3),y_correct))

2   Fail
y_correct = 1; assert(isequal(amountinput(10),y_correct))

Attempt to execute SCRIPT varargin as a function: /opt/mlsedu/matlab/R2019a/toolbox/matlab/lang/varargin.m Error in amountinput (line 2) y=varargin Error in Test2 (line 2) assert(isequal(amountinput(10),y_correct))

3   Fail
y_correct = 7; assert(isequal(amountinput(0,7,3,6,2,7,4),y_correct))

Attempt to execute SCRIPT varargin as a function: /opt/mlsedu/matlab/R2019a/toolbox/matlab/lang/varargin.m Error in amountinput (line 2) y=varargin Error in Test3 (line 2) assert(isequal(amountinput(0,7,3,6,2,7,4),y_correct))