Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
A=magic(4)
x=1
y_correct = [4 4]
assert(isequal(indexmynum(A,x),y_correct))
A =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
x =
1
y_correct =
4 4
ans =
4 4
ans =
4 4
|
2 | Pass |
A=magic(6)
x=22
y_correct = [3 4]
assert(isequal(indexmynum(A,x),y_correct))
A =
35 1 6 26 19 24
3 32 7 21 23 25
31 9 2 22 27 20
8 28 33 17 10 15
30 5 34 12 14 16
4 36 29 13 18 11
x =
22
y_correct =
3 4
ans =
3 4
ans =
3 4
|
Find all elements less than 0 or greater than 10 and replace them with NaN
13048 Solvers
228 Solvers
413 Solvers
113 Solvers
49 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!