octave-maintainers
[Top][All Lists]
Advanced

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

using string as cell selectors


From: CdeMills
Subject: using string as cell selectors
Date: Thu, 2 Sep 2010 02:40:19 -0700 (PDT)

Hello,

the dataframe class nearly passes all tests under 3.3.52+. The last problem
is a failure in expressions like
x.types{"Freq"} = 'uint32'

The logic behind it is: x.types is of class 'cell', we should be able to
select by column name.

Under 3.2.4, the last part of S contains the string "Freq" in the field
"subs". Under 3.3.52+, it fails with 'invalid assignement to cs-list outside
multiple assignment".

I checked under MatLab, the behaviour is to use the ascii code of chars as
selectors: x.type{1} refers to the 49th value, and so on. So x.type{'Freq'}
should refer to 4 values. This mechanism is also used in parenthesis
derefencing. The only way in MatLab to have a selector as string is in
x.('some string')

Should we follow this path, or accept to have strings as element selectors
everywhere ? If we go on the first hypothesis, how to translate actual
expressions like
x(1, "Freq")
x.types{"Freq"}

Regards

Pascal
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/using-string-as-cell-selectors-tp2501035p2501035.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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