Cody

Solution 1216049

Submitted on 19 Jun 2017
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
x= [0 0 1 1 2 2 3 3]; y= [0 1 0 1 0 1 0 1]; z=[-4 -1 -3 -2 0 -1 5 2]; c=[1 -2 3 -4]; assert(isequal(c,round(sufit(x,y,z))))

Error using max Invalid data type. First argument must be numeric or logical. Error in sufit (line 2) max(varargin(1)) Error in TestPoint1 (line 5) assert(isequal(c,round(sufit(x,y,z))))

2   Fail
x= rand(1,100); y= rand(1,100); z=7*x.^2-9*x.*y+11*y.^2-17; c=[7 -9 11 -17]; assert(isequal(c,round(sufit(x,y,z))))

Error using max Invalid data type. First argument must be numeric or logical. Error in sufit (line 2) max(varargin(1)) Error in TestPoint2 (line 5) assert(isequal(c,round(sufit(x,y,z))))

3   Fail
x= rand(1,10000); y= rand(1,10000); z=17*x.^2-19*x.*y+11*y.^2-13; c=[17 -19 11 -13]; assert(isequal(c,round(sufit(x,y,z))))

Error using max Invalid data type. First argument must be numeric or logical. Error in sufit (line 2) max(varargin(1)) Error in TestPoint3 (line 5) assert(isequal(c,round(sufit(x,y,z))))

Suggested Problems

More from this Author100