Cody

Solution 607610

Submitted on 28 Mar 2015 by Zhao Dennis
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.7764 0.7516 0.5868 0.4992 0.9321

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

y = Columns 1 through 18 0.4186 0.2081 0.7996 0.3423 0.9327 0.3288 0.5229 0.2724 0.4679 0.7348 0.6007 0.4438 0.4312 0.8049 0.0752 0.3100 0.0799 0.8734 Columns 19 through 36 0.6449 0.0878 0.3936 0.4452 0.3690 0.9024 0.0701 0.3111 0.0087 0.5346 0.7701 0.4524 0.7363 0.4127 0.8593 0.2756 0.0977 0.7156 Columns 37 through 50 0.9834 0.7327 0.7049 0.6646 0.4607 0.6776 0.9636 0.1346 0.1540 0.2182 0.7717 0.3787 0.5341 0.6550

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