Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Coding for Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100555] Coding for Mathematica
  • From: FAQneeds <thegodfather7769 at aol.com>
  • Date: Mon, 8 Jun 2009 02:04:39 -0400 (EDT)

Im a first time user of Mathematica. So im trying to put in a command related to Newton's Method. I would just like to know if once im done typing this command in am i suppose to see the results immediately or do i have go to something in the program to see the results of my command. Here is the Code please can anyone tell me what im doing wrong i will be really grateful:

In[1] :=(*your name,06/06/09*)
In[2] :=(*Newton's Method*)
In[3] := f[x_] := x^2 - 2
In[4] := x[1] = 1.0
In[5] := For[n = 1, n < 10, n++,
  {x[n + 1] = x[n] - f[x[n]]/f'[x[n]];
   Print[n + 1, "  ", N[x[n + 1], 10]];}]
In[6] := Plot[f[x], {x, 0, 2}]


  • Prev by Date: Re: Mathematica bug??
  • Next by Date: Re: Mathematica bug??
  • Previous by thread: Re: 60Mb dataset
  • Next by thread: Re: Coding for Mathematica