Cody

Solution 1832986

Submitted on 31 May 2019 by Ritik Gupta
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.4440 0.8696 0.1147 0.7085 0.6468

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.1209 0.4261 0.5288 0.7096 0.1206 0.7793 0.2230 0.9987 0.7611 0.0038 0.1145 0.9974 0.0414 0.6090 0.6751 0.8704 0.8450 0.5723 Columns 19 through 36 0.5528 0.5308 0.1891 0.0997 0.3305 0.6769 0.4721 0.6536 0.5553 0.9919 0.8841 0.5300 0.6503 0.3748 0.7934 0.1370 0.2332 0.1957 Columns 37 through 50 0.8781 0.3590 0.6724 0.6322 0.0982 0.8509 0.8372 0.2506 0.5309 0.7678 0.4987 0.9156 0.9198 0.5877

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