[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #32863] x.y.z syntax for structure fails ("sca
[Octave-bug-tracker] [bug #32863] x.y.z syntax for structure fails ("scalar cannot be indexed with .")
Tue, 22 Mar 2011 07:50:30 +0000
Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:184.108.40.206) Gecko/20101203 Firefox/3.6.13
Follow-up Comment #3, bug #32863 (project octave):
After the warning, I get
See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures
Displays Warning for details.
and clicking on it
signing to a nonstructure variable as if it were a structure is not
recommended in MATLAB. For example, if variable x holds a double (as shown
below), then attempting to add a fieldname to it, thus converting x to a
structure, is not good programming practice and should generate an error.
x = 10;
x.name = magic(3);
Note that if x were empty (i.e., x == ), then assigning a field to it as if
it were already a structure is acceptable.
I'm using 7.6.0.
Reply to this item at:
Message sent via/by Savannah