Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2007

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

Search the Archive

Re: Gradient of a List

  • To: mathgroup at
  • Subject: [mg82570] Re: [mg82557] Gradient of a List
  • From: DrMajorBob <drmajorbob at>
  • Date: Thu, 25 Oct 2007 06:03:29 -0400 (EDT)
  • References: <10340059.1193232789565.JavaMail.root@m35>
  • Reply-to: drmajorbob at

data = Table[{x + RandomReal[], Sin@x + 0.1 RandomReal[]}, {x, 0, Pi,
f = Interpolation[data, InterpolationOrder -> 3];
{min, max} = data[[Ordering[data][[{1, -1}]], 1]];
Quiet@Plot[f'[x], {x, min, max}, PlotRange -> All]

I use Quiet because Plot sometimes samples outside the data range and  
throws the InterpolatingFunction::dmval message.

Notice, however, the result isn't even close to Cos[x], and it changes  
quite a bit if you change the InterpolationOrder.


On Wed, 24 Oct 2007 03:34:28 -0500, olalla <operez009 at> wrote:

> Hi everybody,
> Does anybody know how can I get the "gradient" of a list of points?
> My real problem is:
> I have a scalar field previously obtained numerically that for a
> given point (xi,yi) takes a value f(xi,yi). What I want to do is an
> estimation of the gradient of this scalar field BUT I haven't got any
> analytical function that expresses  my field so I can't use the Grad
> function.
> How can I solve this using Mathematica?
> Thanks in advance
> Olalla, Bilbao UPV/EHU


DrMajorBob at

  • Prev by Date: Re: Extracting solutions from Solve[]
  • Next by Date: Re: (x|y) \[element] Integers in Reduce function
  • Previous by thread: Re: Gradient of a List
  • Next by thread: Re: Gradient of a List