Suppose we have a structure myStruct
which has a field named fieldname
whose value is an array. We also have an element of this structure named elem1
and want to access the value of the 1x1
element from its fieldname
array. Here's how we can do this in MATLAB:
main.m169 chars7 lines
In this example, elem1.fieldname(1,1)
will give us the value of the element located in the first row and first column of fieldname
array which is 1
. We can store this value in a variable named value
for further use.
gistlibby LogSnag