Cody

Solution 748530

Submitted on 28 Sep 2015 by Peng Liu
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
%% Example 1 EnableSE(1) a = rand(3)+(1:3)

a = 1.5871 2.0098 3.8742 1.9105 2.6134 3.3848 1.8419 2.0046 3.5523

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

ans = Error using + Matrix dimensions must agree.

3   Pass
%% find a supported function 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)))

4   Pass
%% find an unsupported function 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)

Suggested Problems

More from this Author8