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))
ans =
0.1693 0.6640 0.7947 0.9685 0.7175
|
2 | Pass |
x = rand(1,100);
actual = everyOther(x);
expected = x(1:2:length(x));
assert(isequal(actual, expected))
ans =
Columns 1 through 9
0.4582 0.6313 0.3955 0.6807 0.8771 0.9802 0.2045 0.5351 0.2614
Columns 10 through 18
0.5956 0.0211 0.9081 0.1127 0.3210 0.2377 0.9886 0.6986 0.1685
Columns 19 through 27
0.8702 0.8819 0.7288 0.0707 0.5681 0.0360 0.6803 0.9463 0.0242
Columns 28 through 36
0.8866 0.4584 0.2581 0.7757 0.5079 0.5398 0.6233 0.4282 0.1774
Columns 37 through 45
0.0552 0.0677 0.2533 0.0338 0.2334 0.3550 0.5460 0.0573 0.1443
Columns 46 through 50
0.5172 0.9054 0.6915 0.1561 0.1921
|
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))
ans =
Aogiegiaaayafrwy
|
5833 Solvers
351 Solvers
Return the first and last character of a string
3454 Solvers
convert matrix to single column
307 Solvers
439 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!