From bug-octave-request at bevo dot che dot wisc dot edu Mon Dec 15 15:53:57 2003 Subject: assignment to structure elements fails From: Paul Kienzle To: bug-octave at bevo dot che dot wisc dot edu Date: Mon, 15 Dec 2003 16:53:55 -0500 In octave-2.1.52 Debian and octave-cvs-2003-12-15, I can create a structure element without specifying an index: octave:1> u.hour=1 u = { hour = 1 } I can modify that element: octave:2> u.hour=2 u = { hour = 2 } but I can't do the same for a structure returned from gmtime(): octave:3> t=gmtime(0); octave:4> t.hour=1 error: invalid structure assignment error: assignment to structure element failed error: assignment failed, or no method for `struct = scalar' error: evaluating assignment expression near line 2, column 7 unless I use an explicit index number: octave:5> t(1).hour=2 t = { hour = 2 isdst = 0 mday = 1 min = 0 mon = 0 sec = 0 usec = 0 wday = 4 yday = 0 year = 70 zone = GMT } Paul Kienzle pkienzle at users dot sf dot net ------------------------------------------------------------- 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 -------------------------------------------------------------