Cody

Solution 267082

Submitted on 25 Jun 2013 by Novel Certad
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.3917 0.3970 0.4285 0.6297 0.7774

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.0105 0.9933 0.6031 0.5133 0.9254 0.5382 0.9738 0.1851 0.0126 0.3496 Columns 11 through 20 0.7447 0.2558 0.1693 0.7461 0.4412 0.6099 0.0483 0.7691 0.9007 0.4830 Columns 21 through 30 0.2739 0.3113 0.9043 0.6106 0.9015 0.9745 0.5164 0.9963 0.9721 0.8128 Columns 31 through 40 0.9018 0.7486 0.8844 0.3002 0.1514 0.1247 0.0888 0.3881 0.9898 0.7374 Columns 41 through 50 0.2198 0.6359 0.0554 0.1964 0.3238 0.4503 0.6514 0.5544 0.8074 0.2801

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