Cody

Solution 269892

Submitted on 30 Jun 2013 by BK
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.4362 0.3945 0.8186 0.9311 0.2586

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.5934 0.6128 0.5319 0.4539 0.9661 0.6954 0.3469 0.5567 0.5621 0.4265 Columns 11 through 20 0.7314 0.4542 0.7756 0.4303 0.9452 0.7056 0.3899 0.4594 0.2287 0.0156 Columns 21 through 30 0.0781 0.5002 0.5716 0.6712 0.0560 0.1525 0.4352 0.6174 0.8639 0.9081 Columns 31 through 40 0.5170 0.5594 0.7667 0.9168 0.5051 0.1008 0.5856 0.0830 0.5170 0.9386 Columns 41 through 50 0.4406 0.6559 0.8397 0.5539 0.3672 0.5789 0.4068 0.4438 0.4014 0.4036

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