help-octave
[Top][All Lists]
Advanced

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

Re: inline functions


From: Etienne Grossmann
Subject: Re: inline functions
Date: Sat, 10 Aug 2002 18:34:06 +0100
User-agent: Mutt/1.3.28i

  Hello again,

On Sat, Aug 10, 2002 at 01:32:42PM +0000, Steffan Berridge wrote:
# 
# Hi,
# 
# I have just started using Octave, having used Matlab for a
# while.  In Matlab I have often used inline functions, they
# are very convenient for example when passing a function as
# an argument.
# 
# For example, the following is a function returning the
# square of the argument:
# 
# fun = inline('x^2','x');

  Try the attached m-file, called inline.m.

  Is that, or something alike, worthy of octave-forge?

  Cheers,

  Etienne
 
# One can then pass this function as an argument to another
# function:
# 
# x = foo(fun,...);
# 
# So my question is, is there an equivalent construction in
# Octave?  If not, what is the best way to pass functions as
# arguments?
# 
# Thanks,
# Steffan
# 
# 
# 
# 
# -------------------------------------------------------------
# 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
# -------------------------------------------------------------
# 
# 
# 
# 
# 
-- 
Etienne Grossmann ------ http://www.isr.ist.utl.pt/~etienne

Attachment: inline.m
Description: Text document


reply via email to

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