MATLAB Function Reference    

Create structure argument for subsasgn or subsref



S = substruct(type1,subs1,type2,subs2,...) creates a structure with the fields required by an overloaded subsref or subsasgn method. Each type string must be one of '.', '()', or '{}'. The corresponding subs argument must be either a field name (for the '.' type) or a cell array containing the index vectors (for the '()' or '{}' types).

The output S is a structure array containing the fields:


To call subsref with parameters equivalent to the syntax

you can use

The structure created by substruct in this example contains the following.

See Also

subsasgn, subsref

  subsref subvolume