Cody

Solution 1219210

Submitted on 24 Jun 2017 by Chris Cleveland
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
bounds = [1 5 7 9 24 32]; elements = [1 2 3 4 5 7 8 9 24 25 26 27 28 29 30 31 32]; assert(isequal(ExpandIntervals(bounds),elements))

bounds = 1 5 7 9 24 32

2   Pass
bounds = [9 9 11 11]; elements = [9 11]; assert(isequal(ExpandIntervals(bounds),elements))

bounds = 9 9 11 11

3   Pass
bounds = [100 200 300 400]; elements = [100:200 300:400]; assert(isequal(ExpandIntervals(bounds),elements))

bounds = 100 200 300 400

4   Pass
temp = [-10:10; -10:10]; bounds = temp(:)'; elements = -10:10; assert(isequal(ExpandIntervals(bounds),elements))

bounds = -10 -10 -9 -9 -8 -8 -7 -7 -6 -6 -5 -5 -4 -4 -3 -3 -2 -2 -1 -1 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10

5   Pass
bounds = [-10 10]; elements = -10:10; assert(isequal(ExpandIntervals(bounds),elements))

bounds = -10 10

Suggested Problems

More from this Author9