
[1x21 double] [5] ”
So, if “{ }” are used after a cell array then Matlab returns the array’s contents
but if “( )” are used instead, then it returns cells. To access sub-sets of
information stored in a cell use first “{ }” to access the cell and after used “( )”
to access the info you want.
Before leaving this section, notice the existence of two very useful cell arrays
functions. These are:
c
c
e
e
l
l
l
l
d
d
i
i
s
s
p
p
that recursively displays the contents of a cell
array, and
c
c
e
e
l
l
l
l
p
p
l
l
o
o
t
t displays the structure of a cell array as nested coloured
boxes. Further info for cell arrays can be obtained from the Matlab’s online
help facilities.
6.2 Structures
Structures are Matlab arrays with named data container" called fields. The
fields of a structure can contain any kind of data. For example, one field
might contain a text string representing a name, another might contain a
scalar representing a billing amount, a third might hold a matrix of medical
test results, and so on. Like standard arrays, structures are inherently array
oriented. A single structure is a 1-by-1 structure array, just as the value 5 is
a 1-by-1 numeric array. You can build structure arrays with any valid size or
shape, including multidimensional structure arrays (see figure below) [2].
(Figure copied from [2])
Structures can be created either by using assignment statements or by
using the
s
s
t
t
r
r
u
u
c
c
t
t function.
Commentaires sur ces manuels