Cody

Solution 436685

Submitted on 30 Apr 2014 by Felipe
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 = Columns 1 through 4 0.506239456360340 0.489011637162888 0.971484513008727 0.711783898394454 Column 5 0.933164156942239

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

ans = Columns 1 through 4 0.590134069598342 0.253175078077789 0.220617879750495 0.516373073456983 Columns 5 through 8 0.501656465000313 0.863423197466611 0.696757249392922 0.514820652322294 Columns 9 through 12 0.955082565525119 0.512266934156542 0.780335848117404 0.000589767471230 Columns 13 through 16 0.713287930336449 0.730483159297371 0.312831507675737 0.025749195844750 Columns 17 through 20 0.507795393237749 0.145886017543211 0.131136798360914 0.770062076752103 Columns 21 through 24 0.876007397601384 0.763293058035566 0.628567965993922 0.707556702526080 Columns 25 through 28 0.727673325560835 0.828454896262127 0.106913604357705 0.012430280452795 Columns 29 through 32 0.566042966472936 0.899141336744251 0.983025250017189 0.271892737258176 Columns 33 through 36 0.658294766982223 0.218700495184725 0.833728603009939 0.733654802541088 Columns 37 through 40 0.027839596396237 0.924086668958928 0.911753705661629 0.033441415072159 Columns 41 through 44 0.049420364224082 0.689868262824541 0.318559684939012 0.324508903699233 Columns 45 through 48 0.375157774135078 0.663091973710382 0.383741706788420 0.176743819460619 Columns 49 through 50 0.411349442047695 0.068433819370546

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