This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%% Example 1
EnableSE(1)
a = rand(3)+(1:3)
a =
1.0103 2.4902 3.1864
1.6596 2.6074 3.9827
1.2682 2.2893 3.1344
|
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)
|
647 Solvers
225 Solvers
1735 Solvers
251 Solvers
198 Solvers