help-octave
[Top][All Lists]

## Re: list???

 From: A. Scottedward Hodel Subject: Re: list??? Date: Wed, 16 Jun 1999 10:39:01 -0500

```----------
>Subject: list???
>Date: Wed, Jun 16, 1999, 9:27 AM
>

>Hi,
>
>I can remember that someone mentioned that the data-type "list"
>should be available there. Is that right?
>How does that work?
>I didn't find anything in the online Manual "Edition 3 for Octave
>version 2.0.10
>February 1997"
>http://www.che.wisc.edu/octave/doc/octave_toc.html
>and also not in the release notes....
>
>Bye daniel
>
>--
>Mit freundlichen Gruessen
>                                 Daniel Heiserer

The list data type currently is in only the bleeding-edge (2.1.14)
release.  It behaves like the matlab 5.0 "cell" structure, except that
a list is only one dimensional, whereas the matlab cell structure is not
restricted to be one dimensional.

Functions:
list(): create a list
append(): append items to a list, or concatenate two lists.
nth(): return nth element of a list.
List elements can be of any type, e.g., l1 is a list, joe is a structure,
and woof is a string matrix:

octave> ll = list(l1,joe,woof)
ll =
(
[1] =
(
[1] = 1
[2] = 2
[3] = 3
)
[2] =
{
x = 1
y = 2
}
[3] =

life
the universe
and everything

)

Subscript operations on lists return lists:
octav> item_2_list = ll(2)
item_2_list =
(
[1] =
{
x = 1
y = 2
}
)

The nth function returns the item itself:
octave:13> item_2_value = nth(ll,2)
item_2_value =
{
x = 1
y = 2
}

Further examples are in the Octave controls toolbox, particularly
functions dre (differential riccati equation), sysgetsignals, and
syssetsignals.

A S Hodel Assoc. Prof. Dept Elect Eng, Auburn Univ,AL  36849-5201
On leave at NASA Marshall Space Flight Center (256) 544-1426
Address until 15 Mar 2000:Mail Code TD-55, MSFC, Alabama, 35812
http://www.eng.auburn.edu/~scotte

---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.  To ensure