Test  Status  Code Input and Output 

1  Fail 
x = [1 2 3 4 5];
y = [6 7 8 9 10];
out_mean = [3.5000 4.5000 5.5000 6.5000 7.5000];
assert(isequal(your_fcn_name(x,y),out_mean))
out_mean =
0
out_mean =
3
out_mean =
3 7
out_mean =
3 7 12
out_mean =
3 7 12 18
out_mean =
3 7 12 18 25

2  Fail 
x = [1 1 2 3 5 8 13 21];
y = ones(1,8);
out_mean = [1 1 1.5 2 3 4.5 7 11];
assert(isequal(your_fcn_name(x,y),out_mean))
out_mean =
0
out_mean =
0.5000
out_mean =
0.5000 0.5000
out_mean =
0.5000 0.5000 1.0000
out_mean =
0.5000 0.5000 1.0000 1.5000
out_mean =
0.5000 0.5000 1.0000 1.5000 2.5000
out_mean =
0.5000 0.5000 1.0000 1.5000 2.5000 4.0000
out_mean =
0.5000 0.5000 1.0000 1.5000 2.5000 4.0000 6.5000
out_mean =
0.5000 0.5000 1.0000 1.5000 2.5000 4.0000 6.5000 10.5000

3  Fail 
x = ones(1,100);
y = 7*ones(1,100);
out_mean = 4*ones(1,100);
assert(isequal(your_fcn_name(x,y),out_mean))
out_mean =
0
out_mean =
3.5000

4  Fail 
x = [5 3 8 1 6 7 9 4 2];
y = [3 7 5 6 1 2 9 8 4];
out_mean = [4 5 6.5 3.5 3.5 4.5 9 6 3];
assert(isequal(your_fcn_name(x,y),out_mean))
out_mean =
0
out_mean =
7.5000
out_mean =
7.5000 10.5000

5  Fail 
x = 5:1:1;
y = 1:5;
out_mean = 3*ones(1,5);
assert(isequal(your_fcn_name(x,y),out_mean))
out_mean =
0
out_mean =
2.5000

6  Fail 
x = 42;
y = 42;
out_mean = 0;
assert(isequal(your_fcn_name(x,y),out_mean))
out_mean =
0
out_mean =
882

Sum the elements in either diagonal of a square matrix
173 Solvers
Simple equation: Annual salary
3724 Solvers
145 Solvers
141 Solvers
find the mean of all elements in a matrix
67 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!