Cody

Solution 1038062

Submitted on 30 Oct 2016
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   Pass
EnableSE(1) a = rand(3)+(1:3)

a = 1.5772 2.3369 3.5985 1.4769 2.2270 3.1035 1.2271 2.5150 3.3508

2   Pass
EnableSE(0) try a = magic(3)+(1:3); catch ME getReport(ME,'basic') end

3   Fail
EnableSE(1) yf = yourFcn(1); x = rand(1e2); y = rand(1e2,1); assert(~isequal(yf(x,y),x+y)&&isequal(yf(x,y),bsxfun(yf,x,y)))

Error using yourFcn>@(x)0 Too many input arguments. Error in TestPoint3 (line 5) assert(~isequal(yf(x,y),x+y)&&isequal(yf(x,y),bsxfun(yf,x,y)))

4   Fail
EnableSE(1) yf = yourFcn(0); x = rand(1e2); y = rand(1,1e2); z = bsxfun(yf,x,y); try d = yf(x,y); catch ME1 end assert(exist('ME1','var')>0)

Error using bsxfun First Argument must be a function handle. Error in TestPoint4 (line 5) z = bsxfun(yf,x,y);

Suggested Problems

More from this Author8