[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7. Containers

7.1 Lists  
7.2 Cell Arrays  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.1 Lists

Built-in Function: list (a1, a2, ...)
Create a new list with elements given by the arguments a1, a2, ....

Built-in Function: nth (list, n)
Return the n-th element of list.

Built-in Function: append (list, a1, a2, ...)
Return a new list created by appending a1, a1, ..., to list. If any of the arguments to be appended is a list, its elements are appended individually. For example,

 
x = list (1, 2);
y = list (3, 4);
append (x, y);

results in the list containing the four elements `(1 2 3 4)', not a list containing the three elements `(1 2 (3 4))'.

Built-in Function: reverse (list)
Return a new list created by reversing the elements of list.

Built-in Function: splice (list_1, offset, length, list_2)
Replace length elements of list_1 beginning at offset with the contents of list_2 (if any). If length is omitted, all elements from offset to the end of list_1 are replaced. As a special case, if offset is one greater than the length of list_1 and length is 0, splice is equivalent to append (list_1, list_2).

Built-in Function: islist (x)
Return nonzero if x is a list.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.2 Cell Arrays

Built-in Function: cell (x)
Built-in Function: cell (n, m)
Create a new cell array object. If invoked with a single scalar argument, cell returns a square cell array with the dimension specified. If you supply two scalar arguments, cell takes them to be the number of rows and columns. If given a vector with two elements, cell uses the values of the elements as the number of rows and columns, respectively.

Built-in Function: cellstr (string)
Create a new cell array object from the elements of the string array string.

Built-in Function: iscell (x)
Return true if x is a cell array object. Otherwise, return false.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by John W. Eaton on May, 18 2005 using texi2html