Cody

# Problem 1273. Max index of 3D array

Solution 3491159

Submitted on 31 Oct 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 = zeros(10,10,10); x(5,5,5) = 10; y_correct = [5,5,5]; assert(isequal(Index_Max3d(x),y_correct))

Unrecognized function or variable 'M'. Error in Index_Max3d (line 2) [I1,I2,I3] = ind2sub(size(M),I); Error in Test1 (line 3) assert(isequal(Index_Max3d(x),y_correct))

2   Fail
x = randn(10,10,10); x(7,5,8) = 11; y_correct = [7,5,8]; assert(isequal(Index_Max3d(x),y_correct))

Unrecognized function or variable 'M'. Error in Index_Max3d (line 2) [I1,I2,I3] = ind2sub(size(M),I); Error in Test2 (line 3) assert(isequal(Index_Max3d(x),y_correct))

3   Fail
x = randn(10,10,100); x(10,5,8) = 99; y_correct = [10,5,8]; assert(isequal(Index_Max3d(x),y_correct))

Unrecognized function or variable 'M'. Error in Index_Max3d (line 2) [I1,I2,I3] = ind2sub(size(M),I); Error in Test3 (line 3) assert(isequal(Index_Max3d(x),y_correct))

4   Fail
x = randn(10,10,10); x(1,3,7) = 42; y_correct = [1,3,7]; assert(isequal(Index_Max3d(x),y_correct))

Unrecognized function or variable 'M'. Error in Index_Max3d (line 2) [I1,I2,I3] = ind2sub(size(M),I); Error in Test4 (line 3) assert(isequal(Index_Max3d(x),y_correct))

5   Fail
x = randn(10,10,100); x(4,4,7) = 123456789; y_correct = [4,4,7]; assert(isequal(Index_Max3d(x),y_correct))

Unrecognized function or variable 'M'. Error in Index_Max3d (line 2) [I1,I2,I3] = ind2sub(size(M),I); Error in Test5 (line 3) assert(isequal(Index_Max3d(x),y_correct))

6   Fail
x = randn(10,10,10); x(1,1,9) = 10701; y_correct = [1,1,9]; assert(isequal(Index_Max3d(x),y_correct))

Unrecognized function or variable 'M'. Error in Index_Max3d (line 2) [I1,I2,I3] = ind2sub(size(M),I); Error in Test6 (line 3) assert(isequal(Index_Max3d(x),y_correct))

7   Fail
x = randn(10,10,100); x(1,7,3) = 10701; y_correct = [1,7,3]; assert(isequal(Index_Max3d(x),y_correct))

Unrecognized function or variable 'M'. Error in Index_Max3d (line 2) [I1,I2,I3] = ind2sub(size(M),I); Error in Test7 (line 3) assert(isequal(Index_Max3d(x),y_correct))

### Community Treasure Hunt

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

Start Hunting!