Run m-script from outside a Matlab window

Calls a m-script from a "dos box" without starting the Matlab GUI. Use Matlab's C-compiler.

You are now following this Submission

Ever needed to call an m-script from the command prompt ("dos box")? This C-code allows you to do just that in a simple way. Just call the exe-file you get from compiling it, and it will run the m-code you want. See guide on how to compile and use it in the comment within the code.

Example: I run a calibration software (PEST) written in FORTRAN. It controls all model calls and intermediate calculations. One of the models involved is in FORTRAN, the other in Matlab. With runMscript.exe I simply list my models one by one in a .bat file and am able to work from the command prompt, as PEST was written for.

Cite As

Lars Christiansen (2026). Run m-script from outside a Matlab window (https://www.mathworks.com/matlabcentral/fileexchange/23879-run-m-script-from-outside-a-matlab-window), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0