Structures
Structures are a data type similar to cells. However, where cells use numeric indices to refer to specific pieces of data, structures use strings.
These strings refer to entities called 'fields'. Each field has its own value which can be of any datatype. Fields must be valid identifiers.
student.name = 'Harry'
student.age = 22
student.id = 9028390911
student(end+1).name ='Nicole'
student(end).age = 21
student(end).id = 90294067
stArray = [struct1 struct2]
inner_struct.value = 5;
outer_struct.data = inner_struct;
outer_struct.data.value => 5
student
structure example above, this can be
done:fieldnameA = 'score';
student(1).(fieldnameA) = [56];
student(2).(fieldnameA) = [89];
fieldnameB = 'status';
student(1).(fieldnameB) = ['pending'];
student(2).(fieldnameB) = ['registered'];
> student(2)
ans = struct [
age: 21
id: 90294067
name: Nicole
score: 89
status: registered
]
> student.score
ans = 56
ans = 89
> student.(fieldnameA)
ans = 56
ans = 89
>