Cody

Solution 662057

Submitted on 27 Apr 2015 by Hosain Al Musanna
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.8947 0.8687 0.3782 0.0174 0.5630

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.8746 0.0468 0.6208 0.2343 0.6115 0.3921 0.0803 0.8748 0.1057 0.3974 0.4882 0.8170 0.5465 0.5236 0.0851 0.3903 0.6518 0.4354 Columns 19 through 36 0.0077 0.2224 0.1525 0.0214 0.2918 0.2264 0.7582 0.3471 0.7725 0.3789 0.0081 0.9343 0.7904 0.5073 0.0900 0.8627 0.4463 0.6549 Columns 37 through 50 0.9544 0.6068 0.0208 0.8012 0.6087 0.7533 0.8487 0.3380 0.6461 0.6068 0.0874 0.6296 0.8435 0.2442

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