Problem 2259. Best Fit RMS
Solution Stats
Problem Comments
-
4 Comments
Nice problem Swapnali! Since it has a floating-point answer, you should specify how many significant digits you're looking for, or include a tolerance term in your test suite.
Thanks Ned. Can you please show me how can I add a torelance term for the answer in test suite?
something like this:
assert(abs(BestFit(x,y)-y_correct)<1e-5)
please allow for tolerance in precision of test case answers
Solution Comments
-
1 Comment
Rounding gives me serious trouble on this test. I have tried a variety of methods that all "appear" to return the correct answer, however the assertion fails.
-
1 Comment
can anyone tell me why this isnt working? i rounded to pass one test#.I understand this is a problem. But what else am i missing? precision problem? thanks
Problem Recent Solvers18
Suggested Problems
-
1562 Solvers
-
middleAsColumn: Return all but first and last element as a column vector
482 Solvers
-
570 Solvers
-
Add a row of zeros on top of a matrix
213 Solvers
-
Element by element multiplication of two vectors
311 Solvers
More from this Author25
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!