Cody

# Problem 856. Getting the indices from a matrice

Solution 1976184

Submitted on 14 Oct 2019
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 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')))

Error using strfind Not enough input arguments. Error in MatrixIndices (line 2) out=strfind(A>thresh); Error in Test1 (line 5) assert(isequal(MatrixIndices(x, thresh),y_correct))

2   Fail
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')))

Error using strfind Not enough input arguments. Error in MatrixIndices (line 2) out=strfind(A>thresh); Error in Test2 (line 5) assert(isequal(MatrixIndices(x, thresh),y_correct))

3   Fail
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')))

Error using strfind Not enough input arguments. Error in MatrixIndices (line 2) out=strfind(A>thresh); Error in Test3 (line 5) assert(isequal(MatrixIndices(x, thresh),y_correct))