Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Build MEX File

This example shows how to build the example MEX file timestwo. Use this example to verify the build configuration for your system.

To build a code example, first copy the file to a writable folder on your path.

copyfile(fullfile(matlabroot,'extern','examples','refbook','timestwo.c'),'.','f')

Use the mex command to build the MEX file.

mex timestwo.c
Building with 'Microsoft Visual C++ 2012 (C)'.
MEX completed successfully.

This command creates the file timestwo.ext, where ext is the value returned by the mexext function.

The timestwo function takes a scalar input and doubles it. Call timestwo like a MATLAB® function.

timestwo(4)
ans =
     8

See Also

|

Related Topics

Was this topic helpful?