From bug-request at octave dot org Sat Jan 14 02:11:30 2006 Subject: Re: [OctDev] Proposed changes to cell2mat and inclusion in Octave From: Etienne Grossmann To: Paul Kienzle Cc: Laurent Mazet , "'bug@octave.org' mailing list" , Octave Forge , etienne@cs.uky.edu Date: Sat, 14 Jan 2006 03:07:23 -0500 Hello, both cell2mat({1, 2, 3}) and cell2mat({1; 2; 3}) fail w/ 2.9.3. ====================================================================== octave:12> cell2mat({1; 2; 3}) *** cat: -- Built-in Function: cat (DIM, ARRAY1, ARRAY2, ..., ARRAYN) Return the concatenation of N-d array objects, ARRAY1, ARRAY2, ..., ARRAYN along dimension DIM. [snip] See also: horzcat and vertcat. error: evaluating assignment expression near line 65, column 14 error: evaluating for command near line 64, column 5 error: evaluating for command near line 60, column 3 error: called from `cell2mat'in file `/home/etienne/prog/octave/octave-forge/octave-forge/main/cell/cell2mat.m' octave:12> cell2mat({1, 2, 3}) *** cat: -- Built-in Function: cat (DIM, ARRAY1, ARRAY2, ..., ARRAYN) Return the concatenation of N-d array objects, ARRAY1, ARRAY2, ..., ARRAYN along dimension DIM. [snip] error: evaluating assignment expression near line 69, column 5 error: called from `cell2mat'in file `/home/etienne/prog/octaveøctave-forge/octave-forge/main/cell/cell2mat.m' ====================================================================== version is 2.9.3, home-compiled. More info needed? Hth, Etienne On Sat, Jan 14, 2006 at 12:57:57AM -0500, Paul Kienzle wrote: # Laurent, # # I applied your fix to octave-forge. # # Someone with a working 2.9.x will have to check if the fix is needed # there as well. Here's the test: # # assert (cell2mat({1, 2, 3}), [1, 2, 3]); # assert (cell2mat({1; 2; 3}), [1; 2; 3]); # # See attached for Laurent's fix as a patch to the current octave CVS. # # * general/cell2mat.m: support 1D cell argument. # # - Paul # # On Jan 13, 2006, at 12:16 PM, Laurent Mazet wrote: # # >On Thu, 8 Dec 2005 21:31:56 +0800 # >William Poetra Yoga Hadisoeseno wrote: # >... # > # >Hi, # > # >Sorry I'm late to comment the post. # > # >First, I found a bug on 1D cell argument (file attached). I will # >update the # >octave-forge version as soon I managed to boot again my own coputer (HD # >controler broken :-( ) # > # >Seconldy, I read the code you added for dimension and type checking # >but I don't # >think it's efficient for a such function. This type of function has to # >been run # >as fast as possible and usualy no-ones care of the error message # >(except # >during the debugging process). From my point of view, cell2mat don't # >have to # >waste time on input checking. # > # > Laurent # >-- # >Dr. Laurent Mazet: Research Engineer /V\ Centre de Recherche de # >MOTOROLA # >Tel: +33 1 69 35 48 30 =-=-=-=-=-=-=-= Email: # >laurent dot mazet at motorola dot com # > # # -- Etienne Grossmann ------ http://www.cs.uky.edu/~etienne ------------------------------------------------------------- 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 -------------------------------------------------------------