From: Etienne G. <et...@cs...> - 2004-03-30 19:51:21
|
Hi all, I use, octave 2.1.53, cvs octave-forge, so my prob could be due to not using 2.1.57. Is that the desired behavior of struct()? Are those bugs introduced between r 1.2 and r 1.3 of struct.cc? ====================================================================== octave:3> struct ("a",{1},"b",{1,2}) ans = { a = (, [1] = 1 [2] = 1 ,) b = (, [1] = 1 [2] = 2 ,) } octave:4> struct ("a",{1},"b",{1,2},"c",{}) error: struct: dimensions of parameter 4 do not match those of parameter 6 octave:4> struct () *** struct: struct('field',value,'field',value,...) Create a structure and initialize its value. struct('field',{values},'field',{values},...) Create a structure array and initialize its values. The dimensions of each array of values must match. Singleton cells and non-cell values are repeated so that they fill the entire array. struct('field',{},'field',{},...) Create an empty structure array. ====================================================================== Once upon a time, struct() returned an empty struct, without need to do struct([]). No field-value pair -> empty struct, right? I don't recall that there's anything wrong with having struct values being lists, my code has relied on this for some time now. Any tips welcome, Etienne -- Etienne Grossmann ------ http://www.cs.uky.edu/~etienne |