Cody

Solution 277753

Submitted on 10 Jul 2013 by William Fligor
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.7072 0.1758 0.2836 0.5514 0.7878

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.6960 0.7685 0.3223 0.3842 0.5633 0.1626 0.0204 0.0033 0.1891 0.6003 Columns 11 through 20 0.5665 0.3380 0.1484 0.7872 0.0188 0.9986 0.2181 0.1211 0.7880 0.0837 Columns 21 through 30 0.6393 0.8653 0.2760 0.6666 0.4441 0.5659 0.5528 0.4818 0.8031 0.0786 Columns 31 through 40 0.4655 0.6990 0.2063 0.4022 0.9751 0.3081 0.5602 0.8423 0.5364 0.3702 Columns 41 through 50 0.6332 0.5654 0.0540 0.3905 0.3319 0.6072 0.1435 0.6527 0.0566 0.4609

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