Cody

# Problem 2560. expand intervals vol.2

Solution 497762

Submitted on 9 Sep 2014 by J.R.! Menzinger
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 3 9 24 32]; elements = [1 2 3 4 5 6 7 8 9 24 25 26 27 28 29 30 31 32]; assert(isequal(ExpandIntervals(bounds),elements))

ans = 1 3 24 5 9 32

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

ans = 11 9 11 9

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

ans = 200 100 400 300

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

ans = Columns 1 through 16 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 Columns 17 through 20 6 7 8 9 7 8 9 10

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

ans = -10 10

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!