help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

eval and struct


From: Iago Mosqueira
Subject: eval and struct
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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]