[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: list data structure
From: |
David Bateman |
Subject: |
Re: list data structure |
Date: |
Wed, 08 Feb 2006 12:02:20 +0100 |
User-agent: |
Mozilla Thunderbird 0.8 (X11/20040923) |
Gorazd Brumen wrote:
Dear all,
I am wondering if there is something comparable to lists implemented in
octave. I need a structure that implements an object such as
{ {1,2}, {3,4}, {5}, {} } and can do some basic operations on it -
for example returning the length of the list (in this case 4) and
insert some elements (similar to what Append does in Mathematica(TM) ).
I have looked at the "structure" data type, but it would be a fuss
dealing with that.
Does anybody have a good suggestion?
This isn't a list. Its a cell array and works perfect in a compatiable
fashion to matlab in current versions of octave.
octave:1> a = { {1,2}, {3,4}, {5}, {} };
octave:2> length(a)
ans = 4
octave:3> size(a)
ans =
1 4
octave:4> a{5} = "new element";
octave:5> length(a)
ans = 5
Regards
David
D.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------