Cody

Solution 1993299

Submitted on 28 Oct 2019 by Xiangyu Liu
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

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.7329 0.5257 0.5590 0.3755 0.0027

2   Pass
x = rand(1,100); actual = everyOther(x); expected = x(1:2:length(x)); assert(isequal(actual, expected))

y = Columns 1 through 18 0.3794 0.1532 0.2232 0.4626 0.7242 0.6699 0.0732 0.3967 0.3794 0.4137 0.6825 0.0995 0.1190 0.5114 0.6064 0.8020 0.0128 0.6410 Columns 19 through 36 0.1251 0.6099 0.9344 0.2081 0.1711 0.6854 0.9184 0.9735 0.3894 0.3864 0.8162 0.9250 0.0301 0.2022 0.2531 0.3941 0.0027 0.8357 Columns 37 through 50 0.1128 0.1792 0.2360 0.5603 0.7993 0.9220 0.9386 0.1542 0.2081 0.6052 0.3209 0.1965 0.5236 0.3231

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'

Suggested Problems

More from this Author95