Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = rand(2,2,2);
y = neg2(neg2(x));
y_correct = -x;
assert(isequal(y,y_correct))
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In neg2 at 2
In verifyCode>evaluateCode at 238
In verifyCode at 43
In fevalJSON at 14]
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In neg2 at 2
In verifyCode>evaluateCode at 238
In verifyCode at 43
In fevalJSON at 14]
|
2 | Pass |
%%
x = [];
y = neg2(neg2(x));
y_correct = -x;
assert(isequal(y,y_correct))
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In neg2 at 2
In verifyCode>evaluateCode at 238
In verifyCode at 43
In fevalJSON at 14]
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In neg2 at 2
In verifyCode>evaluateCode at 238
In verifyCode at 43
In fevalJSON at 14]
|
3 | Pass |
%%
x = sqrt(-5);
y = neg2(neg2(x));
y_correct = -x;
assert(isequal(y,y_correct))
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In neg2 at 2
In verifyCode>evaluateCode at 238
In verifyCode at 43
In fevalJSON at 14]
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In neg2 at 2
In verifyCode>evaluateCode at 238
In verifyCode at 43
In fevalJSON at 14]
|
4 | Pass |
%% What does a single call give?
x = rand;
disp(neg2(x))
[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[> In neg2 at 2
In verifyCode>evaluateCode at 238
In verifyCode at 43
In fevalJSON at 14]
1
|
1093 Solvers
895 Solvers
201 Solvers
Back to basics 4 - Search Path
322 Solvers
366 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!