string matrices in .oct files

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

string matrices in .oct files

A S Hodel
I'm translating the octave controls toolbox to .oct files for faster
handling of the data structure.

What data type should be used for string matrices; for example, state
names are stored in a matrix

sys.stname = ["x_1";"x_2"], etc.

I'm using charMatrix, but that appears to be the wrong data type.

A S Hodel Dept. of Elect Eng, 200 Broun Hall Auburn Univ, AL 36849 (334)8441854
FAX:-1809       http://www.eng.auburn.edu/users/scotte    [hidden email]


Reply | Threaded
Open this post in threaded view
|

string matrices in .oct files

John W. Eaton-6
On 25-Sep-1997, A. Scottedward Hodel <[hidden email]> wrote:

| I'm translating the octave controls toolbox to .oct files for faster
| handling of the data structure.
|
| What data type should be used for string matrices; for example, state
| names are stored in a matrix
|
| sys.stname = ["x_1";"x_2"], etc.
|
| I'm using charMatrix, but that appears to be the wrong data type.

You probably want to use string_vector instead.  You can extract a
string_vector object from an octave_value object using all_strings(),
and there is a constructor for octave_values that takes a
string_vector as an argument.

jwe