Motorola DSP Developer's Kit    

Using Motorola DSP MEX-Files

The MATLAB MOT563_MAX Example

The MOT563_MAX function and the MOT563_SMAX S-function block provided in the Motorola DSP56300 Toolbox and Blockset are used as simple examples to illustrate some basic NON_INTERACTIVE mode features. These basic features include:

This tutorial assumes you have configured your environment as per Building Motorola DSP MEX-Files.

Building the MATLAB Function

To use the MATLAB MOT563_MAX function binary in the NON_INTERACTIVE mode, compile the source code file

<matlab>/toolbox/motdsp/motdsp/56300/mot563_max.cpp.

To do so, enter at the MATLAB command line

You can now compile the MATLAB MEX-file by typing the following command

This creates a mot563_max library binary in the current directory.

Running the MATLAB MEX-File

To run the MATLAB MEX-file with a simple example input variable, enter

at the MATLAB command line. This returns the contents of the output variable, y, as determined by the default DSP processor of the DSP56300 family, to the MATLAB workspace.

Optional Command Line Arguments

To change the DSP processor type within a selected DSP family, you must provide a string as an `optional' input argument at the MATLAB command line. For example,

If the chosen DSP device does not exist an error message such as

appears.

Similarly, to select a simulator command file, you must provide a string as an `optional' input argument at the MATLAB command line. For example, type

where my_commands.cmd is a valid simulator command file in the current directory or on the MATLAB path. For more information on command files, see What You Provide.


 Custom Build Process The Simulink MOT563_SMAX Example