Test  Status  Code Input and Output 

1  Pass 
filetext = fileread('push.m');
assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')

2  Pass 
v = [1, 2, 7];
x = [];
[v, n] = push(v, x);
v_correct = [1, 2, 7];
n_correct = 3;
assert(isequal(v, v_correct));
assert(isequal(n, n_correct));
V =
[]
N =
1
m =
3
V =
1 2 7
v =
1 2 7

3  Pass 
v = [];
x = [5, 6, 8];
[v, n] = push(v, x);
v_correct = [5, 6, 8];
n_correct = 3;
assert(isequal(v, v_correct));
assert(isequal(n, n_correct));
V =
[]
N =
0
m =
0
V =
5 6 8
v =
5 6 8

4  Pass 
v = [];
x = [7; 3; 9; 4];
[v, n] = push(v, x);
v_correct = [7; 3; 9; 4];
n_correct = 4;
assert(isequal(v, v_correct));
assert(isequal(n, n_correct));
V =
[]
N =
0
m =
0
V =
7
3
9
4
v =
7
3
9
4

5  Pass 
v1 = randi(10, 1, 5);
x = 5;
[v, n] = push(v1, x);
v_correct = [v1, 5];
n_correct = 6;
assert(isequal(v, v_correct));
assert(isequal(n, n_correct));
V =
[]
N =
1
m =
5
V =
10 10 4 3 5 5
v =
10 10 4 3 5 5

6  Fail 
v = [ones(4, 1)];
x = [3, 5];
[v, n] = push(v, x);
v_correct = [1; 1; 1; 1; 3; 5];
n_correct = 6;
assert(isequal(v, v_correct));
assert(isequal(n, n_correct));
V =
[]
N =
4
m =
1

7  Fail 
v = [zeros(1, 4)];
x = [3; 0];
[v, n] = push(v, x);
v_correct = [0, 0, 0, 0, 3, 0];
n_correct = 6;
assert(isequal(v, v_correct));
assert(isequal(n, n_correct));
v = [8, 2];
x = [];
[v, n] = push(v, x);
v_correct = [8, 2];
n_correct = 2;
assert(isequal(v, v_correct));
assert(isequal(n, n_correct));
V =
[]
N =
1
m =
4

Extract leading nonzero digit
1005 Solvers
Flag largest magnitude swings as they occur
538 Solvers
Change the sign of even index entries of the reversed vector
221 Solvers
422 Solvers
Write a function man that takes a row vector v and returns a matrix H as follows..
243 Solvers