buildExecutable

Create an executable out of a MATLAB function or Simulink model

Syntax

buildExecutable(codename)

Description

buildExecutable(codename) creates an executable out of a MATLAB function or Simulink model. This executable can be run outside of MATLAB on the current desktop computer or on another desktop computer which does not have MATLAB and Simulink installed.

The generated executable and necessary DLL's are placed into a subfolder in the current working directory called "targetfiles".

Examples

Schedule MATLAB Executable

To create an executable out of a MATLAB Function which prints to a terminal at a certain rate, run the following command:

buildExecutable('ScheduleMatlabExecutable')

To run the executable, run it from a terminal. Here is what it would look like in a Windows DOS-prompt:

If the MATLAB code has an fprintf statement, the executable will print to the terminal. ScheduleMatlabExecutable has an fprintf statement as shown here:

Schedule Simulink Executable

To create an executable out of a Simulink model which prints to a terminal at a certain rate, run the following command:

buildExecutable('ScheduleSimulinkExecutable')

Then run the executable from the terminal.