help-octave
[Top][All Lists]
Advanced

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

Integration with constants?


From: Jens Benecke
Subject: Integration with constants?
Date: Sat, 11 Nov 2006 14:48:10 +0100
User-agent: KNode/0.10.4

Hi,

I am trying to integrate a function that has constants previously defined in
the same matlab file. Like this:

[J2, ier, nf,   err] = quad(@(x) log( ...
        sqrt(1 + alpha.^2 + 2.*a.pha.*cos(2.*x)) + alpha + cos(2.*x) ), ...
                0, pi/2, 1e-6)

"alpha" is a constant that has been calculated before. However, Octave tells
me "error: alpha undefined ..."

Do I have to write a seperate .m file for each function I want to be able to
integrate? I thought it was possible using the "@(x)" anonymous function
syntax.

I would appreciate any help or pointers to the right documentation. Thank
you!


-- 
Jens Benecke (jens at spamfreemail.de)
http://www.spamfreemail.de - 100% saubere Postfächer - garantiert!
http://www.rb-hosting.de - PHP ab 9? - SSH ab 19? - günstiger Traffic



reply via email to

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