Documentation

mexext

Binary MEX file-name extension

Syntax

ext = mexext
extlist = mexext('all')

Description

example

ext= mexextreturns the file-name extension for the current platform.

example

extlist= mexext('all')returns the extensions for all platforms.

Examples

collapse all

Find the MEX file extension for the system you are currently working on.

ext = mexext
ext = 'mexa64'

Your results reflect your system.

Get the list of file extensions for supported platforms.

extlist = mexext('all');

Themexcommand identifies a platform by itsarchvalue, which is the output of thecomputer('arch')command. For Mac platforms, the value ismaci64.

Search thearchfield inextlistfor'maci64', and display the correspondingextfield.

fork=1:length(extlist)ifstrcmp(extlist(k).arch,'maci64') disp(sprintf('Arch: %s File Extension: %s', extlist(k).arch, extlist(k).ext))endend
Arch: maci64 File Extension: mexmaci64

Output Arguments

collapse all

File-name extension for MEX file, returned as one of these values.

MEX File Platform-Dependent Extension

Platform Binary MEX File Extension

Linux®(64-bit)

mexa64

AppleMac(64-bit)

mexmaci64

Windows®(64-bit)

mexw64

All file-name extensions, returned as a structure with these fields:

Platform, returned as a character vector. The name of the platform is the output of thecomputer('arch')command.

File extension, returned as a character vector.

Tips

  • To use the MEX file-name extension in makefiles or scripts outside MATLAB®, type one of the following from the system command prompt. The script is located in thematlabroot\binfolder.

    • mexext.bat—Windows platform.

    • mexext.sh—UNIX®platform.

      For example, the following commands are in a GNU®makefile.

      ext = $(shell mexext) yprime.$(ext) : yprime.c mex yprime.c

See Also

|

Introduced before R2006a

Was this topic helpful?