[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Structure assignments
From: |
David Bateman |
Subject: |
Structure assignments |
Date: |
Mon, 27 Aug 2007 14:49:29 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
In looking at how Octave and Matlab handle comma separated lists as
input and output arguments of functions, I noted that structure arrays
can equally be used to create a comma separated list. So I then thought
that something like
x = ceil (randn (10, 1));
in = struct ('call1', {x, Inf, 'last'}, 'call2', {x, Inf, 'first'});
out = struct ('call1', cell (2, 1), 'call2', cell (2, 1));
[out.call1] = find (in.call1);
[out.call2] = find (in.call2);
should be valid and in fact it is in Matlab R20007a. However, in Octave
2.9.13 a comma separated list created from a structure array is only
valid as an input to a function, and not at all on the LHS... What would
be involved in adding this feature? Should it be done before 3.0?
Regards
David
--
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
- Structure assignments,
David Bateman <=