From help-request at octave dot org Thu Dec 29 07:02:46 2005 Subject: wrong size for empty structure array From: Michael Schmid To: help at octave dot org Date: Thu, 29 Dec 2005 13:58:18 +0100 second try to describe the problem 1. again Matlabs behaviour: =================== a = struct; size(a) ans = 1 1 more informations: Size: 1x1 Bytes: 0 Class: struct array a = struct('sub1',[],'sub2^,[]) size(a) ans = 1 1 more informations: Size 1x1 Bytes: 248 Class: struct array a(1) ans = sub1: [] sub2: [] a(1) = [] a = 1x0 struct array with fields: sub1 sub2 size(a) ans = 1 0 the same tests in Octave: ================= a = struct; size(a) ans = 1 1 more informations: Size: 1x1 Bytes: 0 Class: struct **** comment: more or less the same ************** a = struct('sub1',[],'sub2^,[]) size(a) ans = 1 1 more informations: Size 1x1 octave:14> a(1) ans = { sub1 = [](0x0) sub2 = [](0x0) } ********comment, seems to be the same ************* octave:15> a(1)=[] error: octave_base_value::map_value(): wrong type argument `matrix' error: invalid structure assignment error: assignment failed, or no method for `struct = matrix' error: evaluating assignment expression near line 15, column 5 octave:15> ************** so it isn't possible to get an empty structure with the same size like above from Matlab.... *********************************** is this a bug or not?? thanks for any help again.. Michael ------------------------------------------------------------- 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 -------------------------------------------------------------