[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem porting Matlab code containing feval
From: |
LUK ShunTim |
Subject: |
Re: Problem porting Matlab code containing feval |
Date: |
Tue, 14 Feb 2006 21:11:19 +0800 |
User-agent: |
Debian Thunderbird 1.0.7 (X11/20051017) |
V P wrote:
> Hi All:
> I am in the process of porting my old Matlab code to Octave since I no
> longer have access to Matlab.
>
> I recreated the problem in the following snippet:
>
> function test(fn)
> yN = [1.2, 0.8];
> i=0
> while i < 3,
> feval(fn,yN)
> i=i+1;
> end;
> endfunction;
>
> function d=dfns2(y)
> d1=-1 + 2./2.^(16 *(-3.75 + y(:,1)).^2);
> d2=-1 + 2./ 2.^((-8 + y(:,2)).^2);
> d = [d1, d2];
> endfunction
>
> in Octave (2.1.71) I do the following:
>>test(dfns2)
Try test("dfns2") as feval take a string as the name of the function.
Regards,
ST
--
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------