From help-request at octave dot org Tue Apr 12 13:03:11 2005 Subject: Re: function definition From: =?ISO-8859-1?Q?S=F8ren_Hauberg?= To: krizovah at ncifcrf dot gov CC: help-octave at bevo dot che dot wisc dot edu Date: Tue, 12 Apr 2005 20:02:11 +0200 Hi If I understand your problem correctly you can do something like this: function [ ret ] = some_name (a, b, x) ret = a(x) + b(x); endfunction And then call this function with arguments like this: some_name( at sin, @cos, 3) which will give you the value of sin(3) + cos(3) hope that helps, Søren krizovah at ncifcrf dot gov wrote: > > Hello, > > I've got a problem, which, I'm sure will have a trivial solution: > > I need to define a function as a linear combination of other functions, like > > f(x)=a(x)+b(x) > > How can I do it in Octave? > > Thanks a lot, > > Hana. > > ------------------------------------------------- > > > > ------------------------------------------------------------- > 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 > ------------------------------------------------------------- > ------------------------------------------------------------- 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 -------------------------------------------------------------