Cody

Solution 235954

Submitted on 25 Apr 2013 by stefano facchin
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.7743 0.7405 0.4922 0.3818 0.2749

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

ans = Columns 1 through 10 0.6775 0.0392 0.2688 0.7050 0.2974 0.0142 0.6651 0.7809 0.2609 0.4158 Columns 11 through 20 0.4713 0.4187 0.9469 0.5679 0.0707 0.2619 0.9653 0.6835 0.1265 0.0450 Columns 21 through 30 0.6045 0.7329 0.6375 0.1608 0.2922 0.4739 0.0749 0.9075 0.8062 0.9329 Columns 31 through 40 0.2687 0.8600 0.4794 0.9502 0.9159 0.8041 0.1878 0.3648 0.9922 0.9460 Columns 41 through 50 0.2277 0.4827 0.2584 0.0074 0.9945 0.5976 0.9896 0.8826 0.1728 0.5050

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