How does fzero determine its tolerance?
이전 댓글 표시
In the fzero function, according to the help, it is possible to specify a TolX parameter (higher TolX value means less function calls, which in my situation will greatly reduce computation time). I assume this tolerance is the maximum allowed difference between the calculated root and the real root, but as following example shows this apparently not true.
options = optimset('TolX',0.01);
x0 = fzero(@cos,[0.1 3],options); % exact solution of cos(x)=0 is 0.5*pi
errorx = x0 - 0.5*pi % answer is 0.0139 (which is bigger than the tolerance of 0.01)
Note that in this simplified example the error is only slightly bigger than the tolerance, but in my own code the error was more than 10x bigger than the tolerance.
So my question is, what does the TolX parameter do?
How can I specify a maximum error on the result of fzero?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Common Operations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!