Text-only Table of Contents (frame/ no frame)
(8) Matlab Structures Previous Top Next

Structures




Syntax:

>> struct_name(record #).field_name=data


Try:

students.name = 'Sally';
students.grades= [97 93 ];
students(2).name = 'John';
students(2).grades= [94 96 ];

or

students= struct('name',{'Sally','John'},'grades',{[97 93], [94 96]});

students(1).name
students.grades










Previous Top Next


Structures.src  last modified Oct 17, 2007 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College