Cody

Solution 308903

Submitted on 22 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.9063 0.8178 0.5944 0.4253 0.1615 ans = []

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

y = Columns 1 through 9 0.4229 0.5985 0.6959 0.6385 0.0688 0.5309 0.4076 0.7184 0.5313 Columns 10 through 18 0.1056 0.7788 0.0908 0.1537 0.4401 0.4574 0.5181 0.6377 0.2407 Columns 19 through 27 0.2891 0.6951 0.2548 0.6678 0.3445 0.6753 0.6022 0.9160 0.4624 Columns 28 through 36 0.4609 0.3225 0.4714 0.1759 0.4735 0.3411 0.1917 0.2428 0.2691 Columns 37 through 45 0.1887 0.0911 0.6834 0.4257 0.6476 0.6358 0.2089 0.2362 0.6073 Columns 46 through 50 0.4587 0.7703 0.6620 0.8419 0.2564 ans = []

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 ans = []

Suggested Problems

More from this Author95