“structure_name(index_of_entry).field_name( ) ”
For example type: “patient(2).test(2:end,1:end-1)” in the command window to
get:
“ans =
118 118
172 170 ”
Useful build-in functions that can make the structures handling much easier
include:
•
f
f
i
i
e
e
l
l
d
d
n
n
a
a
m
m
e
e
s
s
to get structure field names
•
g
g
e
e
t
t
f
f
i
i
e
e
l
l
d
d that can be used to get structures’ fields
•
i
i
s
s
f
f
i
i
e
e
l
l
d
d that returns a TRUE if field is in structure array
•
r
r
m
m
f
f
i
i
e
e
l
l
d
d that can be used to delete a structure’s field
•
s
s
e
e
t
t
f
f
i
i
e
e
l
l
d
d that can be used to assign a structure field
Structures and cell arrays are very useful when you need to write a program
that handles various data types. It is a challenge to work with such data
types. Before attempting writing a segment of programming code based on
these make sure that you have spent a lot of time reading the Matlab’s
online help.
Commentaires sur ces manuels