help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Derivation with Octave


From: Ben Abbott
Subject: Re: Derivation with Octave
Date: Sun, 2 Mar 2008 10:30:46 -0500


On Mar 2, 2008, at 8:32 AM, Julien Martin wrote:

Hello,
I am a beginner to Octave and would like to perform derivation on some functions. Can anyone please help? What is the syntax of the arguments of the differenciate function?
Thanks in advance,
Julien.

Octave a numerical (not a symbolic) computational tool. If you are looking for symbolic derivatives, please consider Maxima.

For numerical derivatives, there are many methods to accomplish that numerically.

Given you have a pair of vectors, x & y, where y is dependent upon x.

  dydx = diff (y) ./ diff (x);
  xc = x(1:end-1) + diff(x)/2;
  dydx = interp1 (x(n), dydx, xc, "linear", "extrap");

If the function, y, may be accurately represented by a polynomial of order N

  dydx = polyval ( polyder ( polyfit (x, y, N)), x);

Ben


reply via email to

[Prev in Thread] Current Thread [Next in Thread]