Documentation Center

  • Trial Software
  • Product Updates

mexext

Binary MEX-file-name extension

Syntax

Description

example

ext = mexext returns the file-name extension for the current platform.

example

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

Examples

expand all

Display File Extension for Your Computer

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

ext = mexext
ext =
   mexw32

Your results reflect your system.

Find File Extension for Specific Platform

Find the MEX-file extension for the Apple Macintosh systems.

Get the list for supported platforms.

extlist = mexext('all');

The mex function identifies a platform by its arch value, which is the output of the computer('arch') command. For Macintosh platforms, the value is maci64.

Search the arch field in the results, extlist, for 'maci64', and display the corresponding ext field.

for k=1:length(extlist)
   if strcmp(extlist(k).arch, 'maci64')
   disp(sprintf('Arch: %s      Ext: %s', ...
           extlist(k).arch, extlist(k).ext))
end, end
Arch: maci64       Ext: mexmaci64

The file extension is mexmaci64.

Output Arguments

expand all

ext — File-name extensionmexa64 | mexmaci64 | mexw32 | mexw64

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

PlatformBinary MEX-File Extension

Linux® (64-bit)

mexa64

Apple Mac (64-bit)

mexmaci64

Microsoft® Windows® (32-bit)

mexw32

Windows (64-bit)

mexw64

extlist — All file-name extensionsstructure

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

arch — Platformstring

Platform, specified as a string. The name of the platform is the output of the computer('arch') command.

ext — File extensionstring

File extension, specified as a string.

More About

expand all

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 the matlabroot\bin folder.

    • 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
  • MATLAB continues to execute a MEX-file with a .dll extension, but future versions of MATLAB will not support this extension.

See Also

|

Was this topic helpful?