This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x1 = 1;
x2 = 1;
y_correct = zeros(3,3,3);
y_correct(:,:,1) = 1;
y_correct(:,:,1) = 0;
y_correct(:,:,1) = 1/5;
assert(isequal(your_fcn_name(x),y_correct))
[Warning: Function zeros has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function zeros has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function zeros has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function zeros has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
|
2 | Pass |
%%
x1 = 2;
x2 = 1;
y_correct = zeros(3,3,3)
y_correct(:,:,1) = 2;
y_correct(:,:,1) = 1;
y_correct(:,:,1) = 2/5;
assert(isequal(your_fcn_name(x),y_correct))
[Warning: Function zeros has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function zeros has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
y_correct(:,:,1) =
0.4000 0.4000 0.4000
0.4000 0.4000 0.4000
0.4000 0.4000 0.4000
y_correct(:,:,2) =
0 0 0
0 0 0
0 0 0
y_correct(:,:,3) =
0 0 0
0 0 0
0 0 0
[Warning: Function zeros has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
[Warning: Function zeros has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.]
|
Find the sum of all the numbers of the input vector
31969 Solvers
317 Solvers
401 Solvers
Sum the numbers on the main diagonal
453 Solvers
Find out sum and carry of Binary adder
380 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!