Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
filetext = fileread('summ.m');
assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')
|
2 | Pass |
v = randi(10, 1, randi(10));
s = summ(v);
assert(length(s) == length(v) - 1)
ans =
4 7 13 10 7 13 11
|
3 | Pass |
v = 1:10;
s_correct = 3:2:19;
assert(isequal(summ(v),s_correct))
ans =
3 5 7 9 11 13 15 17 19
|
4 | Pass |
v = [1; 2; 4; 4; 5; 8];
s_correct = [3; 6; 8; 9; 13];
assert(isequal(summ(v),s_correct))
ans =
3
6
8
9
13
|
6065 Solvers
Reverse the elements of an array
687 Solvers
266 Solvers
Number of Even Elements in Fibonacci Sequence
665 Solvers
301 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!