Test  Status  Code Input and Output 

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

2  Pass 
filetext = fileread('myProd.m');
assert(isempty(strfind(filetext, 'prod')),'Cannot use prod() function')

3  Pass 
mat = ones(5);
v_correct = ones(1, 5);
assert(isequal(myProd(mat),v_correct))
m =
5
n =
5
v =
[]
x =
1
x =
1
x =
1
x =
1
x =
1
x =
1
v =
1
x =
1
x =
1
x =
1
x =
1
x =
1
x =
1
v =
1 1
x =
1
x =
1
x =
1
x =
1
x =
1
x =
1
v =
1 1 1
x =
1
x =
1
x =
1
x =
1
x =
1
x =
1
v =
1 1 1 1
x =
1
x =
1
x =
1
x =
1
x =
1
x =
1
v =
1 1 1 1 1
x =
1

4  Pass 
mat = [ 1, 2, 3, 4; 5, 6, 7, 2; 2, 3, 4, 5];
v_correct = [10, 36, 84, 40];
assert(isequal(myProd(mat),prod(mat)))
m =
3
n =
4
v =
[]
x =
1
x =
1
x =
5
x =
10
v =
10
x =
1
x =
2
x =
12
x =
36
v =
10 36
x =
1
x =
3
x =
21
x =
84
v =
10 36 84
x =
1
x =
4
x =
8
x =
40
v =
10 36 84 40
x =
1

5  Pass 
m = randi([5,15]);
n = randi([5,15]);
mat = randi(5, n, m);
v_correct = prod(mat);
assert(isequal(myProd(mat),prod(mat)))
m =
6
n =
9
v =
[]
x =
1
x =
5
x =
25
x =
125
x =
625
x =
625
x =
3125
v =
3125
x =
1
x =
3
x =
9
x =
27
x =
54
x =
216
x =
432
v =
3125 432
x =
1
x =
3
x =
9
x =
9
x =
45
x =
90
x =
180
v =
3125 432 180
x =
1
x =
3
x =
3
x =
12
x =
12
x =
24
x =
120
v =
3125 432 180 120
x =
1
x =
3
x =
15
x =
60
x =
300
x =
1200
x =
1200
v =
3125 432 180 120 1200
x =
1
x =
5
x =
20
x =
20
x =
20
x =
100
x =
300
v =
3125 432 180 120 1200 300
x =
1
x =
3
x =
3
x =
6
x =
30
x =
30
x =
90
v =
3125 432 180 120 1200 300 90
x =
1
x =
1
x =
5
x =
5
x =
10
x =
50
x =
250
v =
3125 432 180 120 1200 300 90 250
x =
1
x =
2
x =
2
x =
10
x =
40
x =
200
x =
200
v =
3125 432 180 120 1200 300 90 250 200
x =
1

410 Solvers
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
231 Solvers
Area of an equilateral triangle
1708 Solvers
Matlab Basics  Convert a row vector to a column vector
302 Solvers
Find the average of a random sequance
169 Solvers