Cody

# Problem 2862. Matlab Basics - Pick out parts of a vector

Solution 2712309

Submitted on 19 Jul 2020
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   Fail
x = [1 2 3 4 5 6 7]; y = [5 6 7 2]; assert(isequal(extract_elements(x),y))

Index in position 1 exceeds array bounds (must not exceed 1). Error in extract_elements (line 2) y =x(5:7,2) ; Error in Test1 (line 3) assert(isequal(extract_elements(x),y))

2   Fail
x = [3 7 12 9 4 2 8 3 2 1]; y = [4 2 8 7]; assert(isequal(extract_elements(x),y))

Index in position 1 exceeds array bounds (must not exceed 1). Error in extract_elements (line 2) y =x(5:7,2) ; Error in Test2 (line 3) assert(isequal(extract_elements(x),y))

3   Fail
x = [12.2 16.5 13.2 2.5 9.7 7.6 3.1 1.4]; y = [9.7 7.6 3.1 16.5]; assert(isequal(extract_elements(x),y))

Index in position 1 exceeds array bounds (must not exceed 1). Error in extract_elements (line 2) y =x(5:7,2) ; Error in Test3 (line 3) assert(isequal(extract_elements(x),y))