help-octave
[Top][All Lists]
Advanced

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

Lists of function handles


From: John W. Eaton
Subject: Lists of function handles
Date: Tue, 7 Feb 2006 11:01:19 -0500

On  7-Feb-2006, address@hidden wrote:

| I am trying to create a list of function handles. This seems to be
| possible in Matlab, but generates errors in Octave:
| 
| >>function r = basisFunction1(x)
|       r  =  1;
| endfunction
| 
| >>function r = basisFunction2(x)
|       r  =  x;
| endfunction
| 
| >>a(1)  =  @basisFunction1
| error: can't perform indexed assignment for function handle type
| error: assignment failed, or no method for `<unknown type> = function
| handle'
| error: evaluating assignment expression near line 1, column 6
| 
| Any work-around? Thx

Yes, use cell arrays as David said.

I just wanted to point out that in future versions of Matlab, you
won't be able to use the style of indexing you show above.  I think
R14 gives a warning about it now.

jwe



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