Curve tolerance between the calculated points
Show older comments
In order to plot a curve in MATLAB a set of points is calculated based on some formula. The function FPLOT also supports plotting with some tolerance. Its help says the following about this functionality:
The FPLOT function begins with a minimum step of size (XMAX-XMIN)*TOL.
The step size is subsequently doubled whenever the relative error
between the linearly predicted value and the actual function value is
less than TOL.
So, if I plot a curve based on some expression and with some predefined tolerance TOL, is the error of the line segment approximation between any two calculated points always smaller than TOL?
Sorry, this is not obvious for me.
A confident yes/no answer would suffice, but it's also better to explain the reason and/or give an estimate for the maximal error of approximation of a curve with linear segments if a tolerance algorithm like in FPLOT is used.
4 Comments
You should provide a link to that excerpt in the online documentation. I can't find that explanation of the TOL parameter either in "help fplot" or "doc fplot".
However, I don't see how any general plotting tool could determine the error between a line segment approximation and a continuum of points on the true continuous curve. That would require symbolic analysis at the very least. I imagine perhaps that the line segment approximation between two points is extrapolated to obtain a predicted value at neighboring points. The error spoken of here might be the error between that extrapolation and the true value of the curve.
John D'Errico
on 6 Feb 2014
To be honest, I was not impressed with the help for fplot. I found it quite a bit confusing as to the purpose of the code, the requirements on the function, and all this even for a highly experienced MATLAB user like me.
Matt J
on 6 Feb 2014
I can delete it (or a forum administrator can do this..) if such excerpts are not allowed.
No, I meant you should provide a link to it so that we can know where to find it and read its full text. It wasn't in the help doc...
Accepted Answer
More Answers (0)
Categories
Find more on Code Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!