Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Iteration Script File Help

Subject: Iteration Script File Help

From: Jerry

Date: 26 Apr, 2009 21:03:06

Message: 1 of 3

Hi, Im working on matlab, and need to create a script file that will read an initial approximation to a root, and find it to 14 decimal places, aslo making sure no more than 10 iterations are performed. I have created m-files corresponding to my equation and its derivatives in the form f(x)=0 saved a f,df and ddf and now need to create a script file using Halleys method to iterate. Everything I have tried fails, I've read through my textbook multiple times and I have come to a complete standstill. Any help in what I am to do to create a working script file would be greatly appreciated. If anyone is willing to help but feels I'm being unclear please send me a message anyway and I will try to describe what it is I need to do in more detail.

Subject: Iteration Script File Help

From: Roger Stafford

Date: 26 Apr, 2009 21:27:01

Message: 2 of 3

"Jerry " <jerrycombes@hotmail.co.uk> wrote in message <gt2i6a$ing$1@fred.mathworks.com>...
> Hi, Im working on matlab, and need to create a script file that will read an initial approximation to a root, and find it to 14 decimal places, aslo making sure no more than 10 iterations are performed. I have created m-files corresponding to my equation and its derivatives in the form f(x)=0 saved a f,df and ddf and now need to create a script file using Halleys method to iterate. Everything I have tried fails, I've read through my textbook multiple times and I have come to a complete standstill. Any help in what I am to do to create a working script file would be greatly appreciated. If anyone is willing to help but feels I'm being unclear please send me a message anyway and I will try to describe what it is I need to do in more detail.
--------------
  You need to describe to us what it is you have tried and even then you can usually expect only outlines for possible procedures. It is not enough to state "Everything I have tried fails." Tell us what it is you did that failed.

  It is important that you realize that Halley's iteration method really does work if you start with sufficiently close initial estimates and provided your code faithfully carries out the appropriate processing. When it succeeds it usually converges extremely rapidly but it is comparatively sensitive to the amount of "miss" in initial estimates. There is certainly no guarantee that with just any initial guess it will converge at all, much less that it will converge in no more that ten iterations!

Roger Stafford

Subject: Iteration Script File Help

From: TideMan

Date: 26 Apr, 2009 22:04:50

Message: 3 of 3

On Apr 27, 9:03=A0am, "Jerry " <jerrycom...@hotmail.co.uk> wrote:
> Hi, Im working on matlab, and need to create a script file that will read=
 an initial approximation to a root, and find it to 14 decimal places, aslo=
 making sure no more than 10 iterations are performed. I have created m-fil=
es corresponding to my equation and its derivatives in the form f(x)=3D0 sa=
ved a f,df and ddf and now need to create a script file using Halleys metho=
d to iterate. Everything I have tried fails, I've read through my textbook =
multiple times and I have come to a complete standstill. Any help in what I=
 am to do to create a working script file would be greatly appreciated. If =
anyone is willing to help but feels I'm being unclear please send me a mess=
age anyway and I will try to describe what it is I need to do in more detai=
l.

You need to learn to use the search facility in this newsgroup, and if
that fails ask Google.
There was a posting earlier this month that shows you exactly how to
do it in about 4 lines of code.
It's possibly the same homework assignment!!

Think about a word or words that encapsulate your problem and type
them into the wee box at the top of the page that says: Search this
group

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us