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))
y =
0.7538 0.7703 0.8400 0.0921 0.4788
|
2 | Pass |
x = rand(1,100);
actual = everyOther(x);
expected = x(1:2:length(x));
assert(isequal(actual, expected))
y =
Columns 1 through 9
0.6012 0.6376 0.8282 0.6737 0.1127 0.4064 0.2948 0.2802 0.1720
Columns 10 through 18
0.4467 0.0364 0.0039 0.4061 0.9305 0.0779 0.7590 0.8390 0.7327
Columns 19 through 27
0.8734 0.5665 0.8600 0.2237 0.5823 0.5108 0.3360 0.5869 0.8014
Columns 28 through 36
0.7689 0.4278 0.3266 0.1589 0.1380 0.4114 0.0136 0.2756 0.7463
Columns 37 through 45
0.9087 0.0643 0.0365 0.2504 0.9078 0.7214 0.1264 0.9548 0.4175
Columns 46 through 50
0.2611 0.7939 0.0570 0.7634 0.4704
|
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))
y =
Aogiegiaaayafrwy
|
2197 Solvers
785 Solvers
400 Solvers
Find out sum of all elements of given Matrix
349 Solvers
492 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!