secant method for finding roots

4 次查看(过去 30 天)
Sey
Sey 2014-11-27
评论: Geoff Hayes 2014-11-28
Write a function m-file called secant.m which uses this method to find the root of a given function between points a and b. The function should stop iterating when x_n and x_n-1 have the same value, to e decimal places.
I understand that The function should have 4 arguments: a function f, the points a and b and a number e. I am unsure how to write it given that I have constants instead of number values for the two points.
  1 个评论
Geoff Hayes
Geoff Hayes 2014-11-28
Sey - when you say that you are unsure how to write it given that I have constants instead of number values, do you mean the variables (input parameters) to your function are what is causing the problem? And if so, why? From your description, the function signature would be
function [root] = secant(fun,a,b,epsilon)
How would you implement the secant method given its description found at http://en.wikipedia.org/wiki/Secant_method?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by