|
From: | David Bateman |
Subject: | Re: Lists of function handles |
Date: | Tue, 07 Feb 2006 14:58:19 +0100 |
User-agent: | Mozilla Thunderbird 0.8 (X11/20040923) |
address@hidden wrote:
Hi,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 typeerror: assignment failed, or no method for `<unknown type> = function handle'error: evaluating assignment expression near line 1, column 6 Any work-around? Thx *Andreas Sodeur * RWE Trading GmbH Structuring & Valuation Huyssenallee 2, 45128 Essen intern 70-17755 extern +49(0)201/12-177 55 mobile +49(0)163/63-177 55
You are trying to store the function handle in a matrix object. Try a{1} = @basisFunction1 instead... D. -- David Bateman address@hiddenMotorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob) 91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax) The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary
------------------------------------------------------------- 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 -------------------------------------------------------------
[Prev in Thread] | Current Thread | [Next in Thread] |