This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Types of Structures in MATLAB Function Blocks

In MATLAB Function blocks, you can define structure data as inputs or outputs that interact with bus signals. MATLAB Function blocks also support arrays of buses. You can also define structures inside MATLAB® functions that are not part of MATLAB Function blocks.

The following table summarizes how to create different types of structures in MATLAB Function blocks:

ScopeHow to CreateDetails
InputCreate structure data with scope of Input.You can create structure data as inputs or outputs in the top-level MATLAB function for interfacing to other environments. See Create Structures in MATLAB Function Blocks.
OutputCreate structure data with scope of Output.
LocalCreate a local variable implicitly in a MATLAB function.See Define Scalar Structures for Code Generation.
PersistentDeclare a variable to be persistent in a MATLAB function.See persistent.
ParameterCreate structure data with scope of Parameter.See Define and Use Structure Parameters.

Structures in MATLAB Function blocks can contain fields of any type and size, including muxed signals, buses, and arrays of structures.

Related Examples

More About

Was this topic helpful?