help-octave
[Top][All Lists]
Advanced

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

Re: Functions as variables


From: Christoph Dalitz
Subject: Re: Functions as variables
Date: Thu, 16 Oct 2003 12:17:53 +0200

On Thu, 16 Oct 2003 11:08:41 +0100
Geraint Paul Bevan <address@hidden> wrote:
> 
> | how can I pass a function as a variable input argument to another
> function?
> | I have tried the following, but it does not work:
> 
> you have to pass the function as a string and then use the function
> 'eval' to evaluate it. The following code works:
> 
Thanks!

While looking up the documentation of eval() I have also found the function
feval(), which serves my needs even better.

> command = ['y(i) = ' ,f ,'(x(i));'];
>
This reminds me of something different: can it be that octave lacks a
string concatenation operator? "+" would be the natural candidate, but
does not work.

I can live with strcat() of course, but just writing a+b would be more
convenient.

Christoph



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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