Cody

# Problem 856. Getting the indices from a matrice

Solution 2629858

Submitted on 29 Jun 2020 by Ramesh Kumar V
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
x = [1 2 3;4 5 6;7 8 9]; thresh=5; y_correct = [3 6 8 9]; filetext = fileread('MatrixIndices.m'); assert(isequal(MatrixIndices(x, thresh),y_correct)) assert(isempty(strfind(filetext, 'find')))

m = 3 n = 3 x = 1 4 7 2 5 8 3 6 9 ind = [] ind = 3 ind = 3 6 ind = 3 6 8 ind = 3 6 8 9

2   Pass
x = 1:2:100; thresh=90; y_correct = [46 47 48 49 50]; filetext = fileread('MatrixIndices.m'); assert(isequal(MatrixIndices(x, thresh),y_correct)) assert(isempty(strfind(filetext, 'find')))

m = 1 n = 50 x = 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 ind = [] ind = 46 ind = 46 47 ind = 46 47 48 ind = 46 47 48 49 ind = 46 47 48 49 50

3   Pass
x = 1:2:100'; thresh=90; y_correct = [46 47 48 49 50]; filetext = fileread('MatrixIndices.m'); assert(isequal(MatrixIndices(x, thresh),y_correct)) assert(isempty(strfind(filetext, 'find')))

m = 1 n = 50 x = 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 ind = [] ind = 46 ind = 46 47 ind = 46 47 48 ind = 46 47 48 49 ind = 46 47 48 49 50