help-octave
[Top][All Lists]
Advanced

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

Re: Problem with Integration-1.0.6 package


From: martin_helm
Subject: Re: Problem with Integration-1.0.6 package
Date: Fri, 6 Mar 2009 06:33:41 -0800 (PST)



Marcin Sleczka wrote:
> 
> 
> 
> John W. Eaton-3 wrote:
>> 
>> On  5-Mar-2009, Marcin Sleczka wrote:
>> 
>> 
>> | I create a .m file which contain such a code:
>> | 
>> | function y=test
>> | y=quad2dg('exy', 0, 1, 0, 1);
>> | endfunction;
>> | 
>> | function v=exy(x,y)
>> | v=x.^2.+y.^3;
>> | endfunction;
>> 
>> 
>> If a .m file begins with a "function" keyword, then it can only define
>> one function.  Put each of your functions in separate files.
>> 
>> jwe
>> _______________________________________________
>> Help-octave mailing list
>> address@hidden
>> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>> 
>> 
> 
> Yes, I did create test.m file. The effect was the same. 
> Of course exy is a subfunction.
> 

I just tested this within one script file and exy as a subfunction. The
simple thing is quad2dg will use feval if you pass the function name as a
string which then cannot find a subfunction.

Use a function handle instead
y=quad2dg(@exy, 0, 1, 0, 1);

Then it works also with exy as subfunction


-- 
View this message in context: 
http://www.nabble.com/Problem-with-Integration-1.0.6-package-tp22366716p22373609.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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