help-octave
[Top][All Lists]
Advanced

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

using quad to integral on a circle,


From: Afsshl
Subject: using quad to integral on a circle,
Date: Fri, 18 Feb 2005 05:30:25 EST

Dear matlab/octave user:
 
I like to evalute an integral on a circle
 
 
 
 
which will become
 
 

 

 

 

 

so I tried to program the following matlab/octave code, but it is proved not work

----------------------------------------------------------------------------------------------------------------

 

 

octave:1> function z=f2(x)
>           z = x^2;
>        endfunction;
octave:2> function z=f(x)
>       z=9*quad(@f2, -sqrt(9-x^2), sqrt(9-x^2))-3*x;
>        endfunction;
octave:3> quad(@f, -3, 3)
error: quad: invalid recursive call
error: evaluating binary operator `*' near line 2, column 10
error: evaluating binary operator `-' near line 2, column 47
error: evaluating assignment _expression_ near line 2, column 8
error: called from `f'
error: quad: evaluation of user-supplied function failed
octave:3>

 

 

 

 

 

 

------------------------------------------------------------------------------------------------------------

please help

eric


reply via email to

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