Using Simulink Previous page   Next Page

What Is an Embedded MATLAB Function Block?

The Embedded MATLAB Function block contains a MATLAB function in a Simulink model. The function accepts multiple input signals and produces multiple output signals.

You build the following model in Creating an Example Embedded MATLAB Function:

As in a MATLAB function, in the Embedded MATLAB Function block, you can declare a local variable implicitly through assignment. The variable takes its type and size from the context in which it is assigned. For example, the following code line declares x to be a scalar variable of type double.

Once you define a variable, it cannot be redefined to any other type or size in the function body. For example, you cannot declare x and reassign it as follows:

See Declaring Local Variables Implicitly for detailed descriptions and examples.

In addition to supporting a rich subset of the MATLAB language, an Embedded MATLAB Function block can call any of the following functions:


Previous page  Introduction to Embedded MATLAB Function Blocks Why Use Embedded MATLAB Function Blocks? Next page

© 1994-2005 The MathWorks, Inc.