From help-octave-request at bevo dot che dot wisc dot edu Fri Nov 22 09:20:48 2002 Subject: eval and struct From: "Iago Mosqueira" To: "octave-help" Date: Fri, 22 Nov 2002 15:19:44 -0000 Hi, I am assigning columns of a matrix (y) to elements in a structure (mat), reading the names from a cell of strings (names), as in for el=1:ncols eval(['mat.' names(el,:) '=y(:,' num2str(el) ');']); endif Everything goes fine until the last element, when I get this error (LnPosterior is the name stored in the last field of the cell): error: structure has no member 'LnPosterior' but all previous assigments, 9 if that matters, worked fine. If I issue in the debug command line mat.LnPosterior=y(:,10), then it works, but not through eval. Any ideas what might be happening? Many thanks, iago ------------------------------------------------------------- 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 -------------------------------------------------------------