Cody

Solution 160288

Submitted on 10 Nov 2012 by Jigar Gada
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))

ans = 0.6977 0.7012 0.0109 0.0343 0.6533

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

ans = Columns 1 through 6 0.2800 0.8888 0.7861 0.4035 0.7082 0.0107 Columns 7 through 12 0.5433 0.2644 0.6379 0.8946 0.2068 0.1536 Columns 13 through 18 0.1286 0.4536 0.0898 0.0765 0.7477 0.3051 Columns 19 through 24 0.9820 0.5766 0.2921 0.5737 0.9582 0.1497 Columns 25 through 30 0.1131 0.7926 0.0792 0.7754 0.8389 0.6981 Columns 31 through 36 0.3968 0.9227 0.6295 0.2163 0.6780 0.5173 Columns 37 through 42 0.8528 0.0166 0.9441 0.8500 0.4341 0.5044 Columns 43 through 48 0.9082 0.1327 0.3180 0.8292 0.9130 0.1685 Columns 49 through 50 0.3483 0.7314

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))

ans = Aogiegiaaayafrwy