matlab.buildtool.tasks.MexTask Class
Namespace: matlab.buildtool.tasks
Superclasses: matlab.buildtool.Task
Description
The matlab.buildtool.tasks.MexTask
class provides a build task for
compiling and linking source files into a binary MEX file. To build a MEX file, the task runs
the mex
command. You must have a supported compiler
installed on your system to run this task.
Tasks that you create with the MexTask
class support incremental builds.
For more information, see Up-To-Date Check.
Creation
Description
task = matlab.buildtool.tasks.MexTask(
creates a task for building a MEX file. The task compiles and links the specified source
files into a binary MEX file and saves it to the specified output folder.sourceFiles
,outputFolder
)
task = matlab.buildtool.tasks.MexTask(
sets the sourceFiles
,outputFolder
,Name=Value)Filename
and Options
properties using one or more name-value arguments. You can
also set the Description
and Dependencies
properties, which the class inherits from the Task
class,
using name-value arguments. For example, task =
matlab.buildtool.tasks.MexTask("mymex.c","output",Options="-R2018a")
creates a
task that builds a MEX file by using the interleaved complex API
(-R2018a
).
Input Arguments
Properties
Methods
Examples
More About
Tips
A
MexTask
instance respects the build output verbosity level specified at run time using the-verbosity
option of thebuildtool
command. The run-time verbosity level takes precedence over any value specified in theOptions
property. (since R2024b)You cannot overwrite or remove the action of a built-in task, but you can specify additional task actions. For example, append an action to the
Actions
property of a built-in task.plan("myTask").Actions(end+1) = @myAction;