Cody

Solution 2184470

Submitted on 31 Mar 2020 by Noa van Dijk
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.8769 0.7539 0.0192 0.2711 0.6315

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.9952 0.9321 0.1215 0.3437 0.9880 0.4926 0.9433 0.2346 0.2042 0.0938 0.5234 0.7814 0.6309 0.0667 0.9507 0.6435 0.2306 0.0670 Columns 19 through 36 0.2401 0.0356 0.0935 0.1700 0.6954 0.4673 0.9603 0.8751 0.4402 0.9072 0.6975 0.8320 0.9850 0.5106 0.9531 0.5009 0.2927 0.0274 Columns 37 through 50 0.9182 0.7706 0.0724 0.3842 0.7707 0.5636 0.7144 0.0999 0.8320 0.7321 0.2285 0.7142 0.1299 0.8459

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