Cody

Solution 328699

Submitted on 4 Oct 2013 by Antonio Garcia-Martinez
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.9706 y = 0.9706 0.4854 y = 0.9706 0.4854 0.1419 y = 0.9706 0.4854 0.1419 0.9157 y = 0.9706 0.4854 0.1419 0.9157 0.9595

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

y = 0.0357 y = 0.0357 0.9340 y = 0.0357 0.9340 0.7577 y = 0.0357 0.9340 0.7577 0.3922 y = 0.0357 0.9340 0.7577 0.3922 0.1712 y = 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 y = 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 y = 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 y = 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 y = 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Column 11 0.3816 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 12 0.3816 0.7952 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 13 0.3816 0.7952 0.4898 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 14 0.3816 0.7952 0.4898 0.6463 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 15 0.3816 0.7952 0.4898 0.6463 0.7547 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 16 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 17 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 18 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 19 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Column 21 0.2551 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 22 0.2551 0.6991 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 23 0.2551 0.6991 0.9593 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 24 0.2551 0.6991 0.9593 0.1386 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 25 0.2551 0.6991 0.9593 0.1386 0.2575 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 26 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 27 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 28 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 29 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 30 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 0.4733 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 30 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 0.4733 Column 31 0.8308 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 30 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 0.4733 Columns 31 through 32 0.8308 0.5497 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 30 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 0.4733 Columns 31 through 33 0.8308 0.5497 0.2858 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 30 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 0.4733 Columns 31 through 34 0.8308 0.5497 0.2858 0.7537 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 30 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 0.4733 Columns 31 through 35 0.8308 0.5497 0.2858 0.7537 0.5678 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 30 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 0.4733 Columns 31 through 36 0.8308 0.5497 0.2858 0.7537 0.5678 0.0540 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 30 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 0.4733 Columns 31 through 37 0.8308 0.5497 0.2858 0.7537 0.5678 0.0540 0.7792 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 30 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 0.4733 Columns 31 through 38 0.8308 0.5497 0.2858 0.7537 0.5678 0.0540 0.7792 0.1299 y = Columns 1 through 10 0.0357 0.9340 0.7577 0.3922 0.1712 0.0318 0.0462 0.8235 0.3171 0.0344 Columns 11 through 20 0.3816 0.7952 0.4898 0.6463 0.7547 0.6797 0.1626 0.4984 0.3404 0.2238 Columns 21 through 30 0.2551 0.6991 0.9593 0.1386 0.2575 0.2543 0.2435 0.3500 0.2511 0.4733 Columns 31 through 39 0.8308 0.5497 0.2858 0.753...

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 = A y = Ao y = Aog y = Aogi y = Aogie y = Aogieg y = Aogiegi y = Aogiegia y = Aogiegiaa y = Aogiegiaaa y = Aogiegiaaay y = Aogiegiaaaya y = Aogiegiaaayaf y = Aogiegiaaayafr y = Aogiegiaaayafrw y = Aogiegiaaayafrwy