[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
one-dimensional integration over two-dimensional function
From: |
John W. Eaton |
Subject: |
one-dimensional integration over two-dimensional function |
Date: |
Mon, 10 Mar 2008 13:06:39 -0400 |
On 10-Mar-2008, Patrick David wrote:
| Hello out there,
|
| I used MATLAB a few times but I am still beginner. Here is my problem:
|
| function retval = foo(x,y)
| retval = x + y;
| endfunction
|
| I want to calculate the integration of foo in the limits from x=3 to x=5,
| y shall be konstant (lets say y=10)!
|
| quad("foo(x,10)", 3, 5) --> works
| quad(@(x) foo(x,10), 3, 5 --> works too
| n = 10
| quad("foo(x,n)", 3, 5) --> doesn't work
| quad(@(x) foo(x,n), 3, 5 --> doesn't work too
What version of Octave are you using? The
n = 10;
quad (@(x) foo (x, n), 3, 5)
seems to work properly in the current stable version of Octave
(3.0.0).
jwe