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))
|
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)))
|
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)))
|
2486 Solvers
"Low : High - Low : High - Turn around " -- Create a subindices vector
320 Solvers
Duplicate each element of a vector.
518 Solvers
Matrix with different incremental runs
249 Solvers
Matlab Basics II - Count rows in a matrix
255 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!