Cody

Solution 308075

Submitted on 21 Aug 2013 by Cui Xiaopeng
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.1812 0.8846 0.9103 0.1063 0.9575

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.8859 0.8413 0.7243 0.9470 0.4749 0.8956 0.0171 0.4384 0.2254 0.0145 Columns 11 through 20 0.7105 0.2028 0.3970 0.7017 0.2113 0.8922 0.9843 0.7437 0.9978 0.4272 Columns 21 through 30 0.8519 0.2842 0.7741 0.4771 0.3917 0.3970 0.4285 0.6297 0.7774 0.0105 Columns 31 through 40 0.9933 0.6031 0.5133 0.9254 0.5382 0.9738 0.1851 0.0126 0.3496 0.7447 Columns 41 through 50 0.2558 0.1693 0.7461 0.4412 0.6099 0.0483 0.7691 0.9007 0.4830 0.2739

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

Suggested Problems

More from this Author95