Cody

Solution 694393

Submitted on 1 Jul 2015 by Swapnil Kulkarni
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.0865 0.9196 0.0442 0.4692 0.7632

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

ans = Columns 1 through 9 0.7261 0.9714 0.0524 0.9439 0.8860 0.1923 0.5041 0.3960 0.1834 Columns 10 through 18 0.1751 0.3625 0.4071 0.9590 0.0943 0.0981 0.5695 0.0094 0.4221 Columns 19 through 27 0.3039 0.8037 0.3948 0.3748 0.7903 0.7211 0.2871 0.5193 0.9785 Columns 28 through 36 0.4518 0.2608 0.7176 0.2159 0.7404 0.9246 0.9509 0.6393 0.6487 Columns 37 through 45 0.6124 0.8495 0.5157 0.2004 0.6377 0.3290 0.1883 0.4899 0.4217 Columns 46 through 50 0.6659 0.3351 0.0609 0.9631 0.6257

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

Suggested Problems

More from this Author95