help-octave
[Top][All Lists]
Advanced

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

Re: Numerical Differentiation and Integration of Array Data


From: Jordi Gutiérrez Hermoso
Subject: Re: Numerical Differentiation and Integration of Array Data
Date: Fri, 2 Dec 2011 15:55:35 -0500

2011/12/2 Jordi Gutiérrez Hermoso <address@hidden>:
> On 2 December 2011 15:44, syberraith <address@hidden> wrote:
>> I can find only one brief example of how to use diff to estimate a derivative
>> and that omits an explanation of how exactly diff computes it results.
>
> Try this:
>
>    t = linspace(0,2*pi,200);
>    s = sin(t);
>    c = diff(sin(t)) ./ diff(t);
>
>    plot(t, s, "-r;;sin(t)", t(2:end), c, "-b;;cos(t)");

Sorry, this last line should have been

       plot(t, s, ";sin(t);-r", t(2:end), c, ";cos(t);-b");

- Jordi G. H.


reply via email to

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