Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = rand(1,10);
actual = everyOther(x);
expected = x(1:2:length(x));
assert(isequal(actual, expected))
lng =
10
|
2 | Pass |
x = rand(1,100);
actual = everyOther(x);
expected = x(1:2:length(x));
assert(isequal(actual, expected))
lng =
100
|
3 | Pass |
x = ['A' 'long' 'time' 'ago' 'in' 'a' 'galaxy' 'far' 'far' 'away'];
actual = everyOther(x);
expected = x(1:2:length(x));
assert(isequal(actual, expected))
lng =
31
|
349 Solvers
309 Solvers
Reverse the elements of an array
687 Solvers
Back to basics - mean of corner elements of a matrix
297 Solvers
There are 10 types of people in the world
310 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!