MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

patient(2).name = 'Ann Lane';
patient(2).billing = 28.50;
patient(2).test = [68, 70, 68; 118, 118, 119; 172, 170, 169];
patient


patient = 1x2 struct array with fields:
name
billing
test


Each patient record in the array is a structure of class struct. An array of structures is
often referred to as a struct array. Like other MATLAB arrays, a struct array can have any
dimensions.


A struct array has the following properties:



  • All structs in the array have the same number of fields.

  • All structs have the same field names.

  • Fields of the same name in different structs can contain different types or sizes of
    data.


Create Structure Array
Free download pdf