This solution is outdated. To rescore this solution, sign in.
-
2 Comments
Carlos Manuel Fernández
on 24 Mar 2016
I tried this one in MATLAB and it worked but here it keeps displaying assertion failed for every number different from 1
Tim
on 24 Mar 2016
Because you are using floating point calculations, the result may not be exact. If you round the result to the nearest integer it should work.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!