Sigh...a little challenge with tolerance? :)
haha~just finish it as fast as I can, didn't have time realizing how stupid this answer is. I saw your answer by the way, it just avoid the tolerance issue with avoiding obvious subtract, brilliant move!
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [45,45]
y_correct = 0
assert(isequal(your_fcn_name(x),y_correct))
x =
45 45
y_correct =
0
|
2 | Pass |
x=[27,327]
y_correct=1/2
assert(isequal(your_fcn_name(x),y_correct))
x =
27 327
y_correct =
0.5000
|
3 | Pass |
x=[546,273]
y_correct=1/3
assert(isequal(your_fcn_name(x),y_correct))
x =
546 273
y_correct =
0.3333
|
Find common elements in matrix rows
1232 Solvers
753 Solvers
First non-zero element in each column
593 Solvers
Replace multiples of 5 with NaN
358 Solvers
275 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!