MATLAB dynamically linked subroutine file
File type: Various data file
The .mexsg file is a compiled MATLAB dynamically linked subroutine, also known as a MEX-file. It contains native binary code that MATLAB loads as a callable function.
The file belongs to MATLAB and is used as executable code rather than as a general-purpose document or portable data file.
File type category:
Various data file
Date updated: September 28, 2026
MATLAB, developed by MathWorks, uses dynamically linked subroutines to extend the software with compiled native code. A .mexsg file contains the compiled implementation of a MATLAB-callable routine that MATLAB loads when the routine is invoked.
MEX files are dependent on the target platform, processor architecture, and compatible MATLAB release. It is a binary file, not MATLAB source code or a portable data format.
Use a compatible MATLAB installation to load the .mexsg file. Put the file in the MATLAB path, then call its associated function from the MATLAB command window or a MATLAB program.
MATLAB does not open this file as a document. If the binary is from an older platform or release, it may fail to load in current MATLAB versions, and there is no general-purpose viewer for it.
A .mexsg file cannot usually be converted meaningfully because it contains compiled executable code, not document data.
To use the routine on another platform or with a current MATLAB release, obtain its original source code and recompile it with MATLAB's MEX build system for the target platform. A binary file without its source cannot generally be converted into a current MEX file.
Software applications that handle other tasks involving mexsg files:
Multiplatform