On Mon, Sep 3, 2012 at 12:46 PM, Ben Abbott
<address@hidden> wrote:
On Sep 3, 2012, at 7:59 AM, Mahvish Nazir wrote:
> What if we have a function say (cos(t^2))^2*exp(i*t) and we want to plot its integral over the limits -5 to 5? how do we do that?
I apologize if this isn't particularly helpful .... *but* we recently added splinefit() to Octave (not yet included in a released version). Using this function (see the attached m-file), the result illustrated in the attached pdf was produced. If you'd like to use this function, you can download splinefit.m at the link below.
http://hg.savannah.gnu.org/hgweb/octave/file/2dd4f5930108/scripts/polynomial
You'll also need the __splitfit__.m which is in the "private" directory.
Ben
t=-8:.1:8;
y=((cos(t.^2)).^2) .*exp(i*t);
q=cumtrapz(t,y);
plot(t,q,t,y)
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave