Cody

Solution 2172187

Submitted on 24 Mar 2020 by Simon Hönes
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))

vec = [] z = 1 y = 10 vec = 0.0570 vec = 0.0570 0.5328 vec = 0.0570 0.5328 0.1737 vec = 0.0570 0.5328 0.1737 0.5537 vec = 0.0570 0.5328 0.1737 0.5537 0.4344

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

vec = [] z = 1 y = 100 vec = 0.9769 vec = 0.9769 0.1581 vec = 0.9769 0.1581 0.8662 vec = 0.9769 0.1581 0.8662 0.6444 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 vec = 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Column 18 0.9044 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 19 0.9044 0.3564 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 20 0.9044 0.3564 0.8533 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 21 0.9044 0.3564 0.8533 0.2493 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 22 0.9044 0.3564 0.8533 0.2493 0.0527 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 23 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 24 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 25 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 26 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 27 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 28 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 29 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 30 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 31 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 0.7348 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 32 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 0.7348 0.7241 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 33 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 0.7348 0.7241 0.9994 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 34 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 0.7348 0.7241 0.9994 0.0435 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 34 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 0.7348 0.7241 0.9994 0.0435 Column 35 0.0862 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 34 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 0.7348 0.7241 0.9994 0.0435 Columns 35 through 36 0.0862 0.7868 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 34 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 0.7348 0.7241 0.9994 0.0435 Columns 35 through 37 0.0862 0.7868 0.7487 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 34 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 0.7348 0.7241 0.9994 0.0435 Columns 35 through 38 0.0862 0.7868 0.7487 0.3732 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 34 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 0.7348 0.7241 0.9994 0.0435 Columns 35 through 39 0.0862 0.7868 0.7487 0.3732 0.5887 vec = Columns 1 through 17 0.9769 0.1581 0.8662 0.6444 0.3833 0.7721 0.4757 0.6660 0.1229 0.7158 0.5454 0.6633 0.5672 0.6042 0.9093 0.9667 0.4705 Columns 18 through 34 0.9044 0.3564 0.8533 0.2493 0.0527 0.8696 0.8076 0.4978 0.1074 0.4188 0.9555 0.9265 0.6446 0.7348 0.7241 0.9994 0.0435 Columns 35 through 40 0.0862 0.7868 0.7487 0.3732 0.5887 0.4010 vec = Columns 1 through 17 0.9769 ...

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))

vec = [] z = 1 y = 31 vec = 'A' vec = 'Ao' vec = 'Aog' vec = 'Aogi' vec = 'Aogie' vec = 'Aogieg' vec = 'Aogiegi' vec = 'Aogiegia' vec = 'Aogiegiaa' vec = 'Aogiegiaaa' vec = 'Aogiegiaaay' vec = 'Aogiegiaaaya' vec = 'Aogiegiaaayaf' vec = 'Aogiegiaaayafr' vec = 'Aogiegiaaayafrw' vec = 'Aogiegiaaayafrwy'

Suggested Problems

More from this Author95