Cody

Solution 204976

Submitted on 17 Feb 2013 by Ahmed Ayoub
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.6385 0.0688 0.5309 0.4076 0.7184

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

y = Columns 1 through 10 0.5313 0.1056 0.7788 0.0908 0.1537 0.4401 0.4574 0.5181 0.6377 0.2407 Columns 11 through 20 0.2891 0.6951 0.2548 0.6678 0.3445 0.6753 0.6022 0.9160 0.4624 0.4609 Columns 21 through 30 0.3225 0.4714 0.1759 0.4735 0.3411 0.1917 0.2428 0.2691 0.1887 0.0911 Columns 31 through 40 0.6834 0.4257 0.6476 0.6358 0.2089 0.2362 0.6073 0.4587 0.7703 0.6620 Columns 41 through 50 0.8419 0.2564 0.5822 0.8699 0.3181 0.9398 0.4795 0.5447 0.5439 0.5225

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