Cody

Solution 788694

Submitted on 4 Dec 2015 by Pedro Pascual González
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.5679 y = 0.5679 0.1947 y = 0.5679 0.1947 0.5387 y = 0.5679 0.1947 0.5387 0.8442 y = 0.5679 0.1947 0.5387 0.8442 0.0751

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

y = 0.8051 y = 0.8051 0.7275 y = 0.8051 0.7275 0.4438 y = 0.8051 0.7275 0.4438 0.5893 y = 0.8051 0.7275 0.4438 0.5893 0.5622 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 y = 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Column 18 0.7318 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 19 0.7318 0.2732 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 20 0.7318 0.2732 0.1628 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 21 0.7318 0.2732 0.1628 0.6469 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 22 0.7318 0.2732 0.1628 0.6469 0.8006 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 23 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 24 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 25 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 26 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 27 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 28 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 29 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 30 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 31 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 32 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 0.3296 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 33 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 0.3296 0.6195 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 34 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 0.3296 0.6195 0.0708 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 34 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 0.3296 0.6195 0.0708 Column 35 0.7188 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 34 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 0.3296 0.6195 0.0708 Columns 35 through 36 0.7188 0.8447 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 34 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 0.3296 0.6195 0.0708 Columns 35 through 37 0.7188 0.8447 0.0855 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 34 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 0.3296 0.6195 0.0708 Columns 35 through 38 0.7188 0.8447 0.0855 0.7949 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 34 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 0.3296 0.6195 0.0708 Columns 35 through 39 0.7188 0.8447 0.0855 0.7949 0.3405 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 34 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 0.3296 0.6195 0.0708 Columns 35 through 40 0.7188 0.8447 0.0855 0.7949 0.3405 0.5002 y = Columns 1 through 17 0.8051 0.7275 0.4438 0.5893 0.5622 0.7539 0.1875 0.5027 0.3481 0.9707 0.3428 0.5533 0.7451 0.4662 0.8496 0.0225 0.9698 Columns 18 through 34 0.7318 0.2732 0.1628 0.6469 0.8006 0.3441 0.1884 0.1729 0.6059 0.1935 0.1631 0.6961 0.2329 0.7372 0.3...

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

Suggested Problems

More from this Author95