Defining Memory Sections

Editing Memory Section Properties

After you have satisfied the requirements in Requirements for Defining Memory Sections, you can define memory sections and specify their properties. To create new memory sections or specify memory section properties,

  1. Choose View > Model Explorer in the model window.

    The Model Explorer appears.

  2. Choose Tools > Custom Storage Class Designer in the Model Explorer window.

    A notification box appears that states Please Wait ... Finding Packages. After a brief pause, the notification box closes and the Custom Storage Class Designer appears.

  3. Click the Memory Section tab of the Custom Storage Class Designer. The Memory Section pane looks like this:

The rest of this section describes the use of the Memory section subpane on the lower left. For descriptions of the other subpanes, instructions for validating memory section definitions, and other information, see Editing Memory Section Definitions.

Specifying the Memory Section Name

To specify the name of a memory section, use the Name field. A memory section name must be a legal MATLAB identifier.

Specifying a Qualifier for Custom Storage Class Data Definitions

To specify a qualifier for custom storage class data definitions in a memory section, enter the components of the qualifier below the Name field.

The qualifier will appear in generated code with its components in the same left-to-right order in which their definitions appear in the dialog box. A preview appears in the Pseudocode preview subpane on the lower right.

Specifying Comment and Pragma Text

To specify a comment, pre-pragma, or post-pragma for a memory section, enter the text in the appropriate edit boxes on the left side of the Custom Storage Class Designer. These boxes accept multiple lines separated by ordinary Returns.

Surrounding Individual Definitions with Pragmas

If the Pragma surrounds field for a memory section specifies Each variable, the code generator will surround each definition in a contiguous block of definitions with the comment, pre-pragma, and post-pragma defined for the section. This behavior occurs with all categories of definitions.

If the Pragma surrounds field for a memory section specifies All variables, the code generator will insert the comment and pre-pragma for the section before the first definition in a contiguous block of custom storage class data definitions, and the post-pragma after the last definition in the block.

Including Identifier Names in Pragmas

When pragmas surround each separate definition in a contiguous block, you can include the string %<identifier> in a pragma. The string must appear without surrounding quotes.

You can use %<identifier> with pragmas only when pragmas to surround each variable. The Validate phase will report an error if you violate this rule.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS