Cody

# Problem 375. N-Dimensional Array Slice

Solution 1143158

Submitted on 22 Mar 2017
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
A = randn(5,5); assert(isequal(arraySlice(A,4,2),A(:,4)))

Error: You may not use the command(s) evalc in your code

2   Fail
A = randn(5,5); assert(isequal(arraySlice(A,4,1),A(4,:)))

Error: You may not use the command(s) evalc in your code

3   Fail
A = randn(5,5); assert(isequal(arraySlice(A,1,10),A))

Error: You may not use the command(s) evalc in your code

4   Fail
A = randn(5,5,5,3); assert(isequal(arraySlice(A,3,4),A(:,:,:,3)))

Error: You may not use the command(s) evalc in your code

5   Fail
A = randn(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2); assert(isequal(arraySlice(A,2,18),A(:,:,:,:,:,:,:,:,:,:,:,:,:,:,:,:,:,2)))

Error: You may not use the command(s) evalc in your code

### Community Treasure Hunt

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

Start Hunting!