I believe your second test case is incorrectly rounding.
Yes, you were right with my earlier incorrect "note well" remark but now with corrected remark in place this test is valid. Sorry if it has put you off a bit. I guess other issues may come to light as well but I hope not.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = 50;
y_correct = 184;
assert(isequal(decay(x),y_correct))
|
2 | Fail |
%%
x = 60;
y_correct = 132;
assert(isequal(decay(x),y_correct))
Error: Assertion failed.
|
4596 Solvers
Test if a Number is a Palindrome without using any String Operations
181 Solvers
Back to basics 4 - Search Path
321 Solvers
Solve the set of simultaneous linear equations
273 Solvers
232 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!