Matlab Daemon

A Bash script & Mex program which allows for #!-style scripting against a background Matlab session.
698 Downloads
Updated 24 Jan 2011

View License

Unfortunately Mathworks has not designed Matlab to behave like the typical Unix interpreter, i.e., there is no #! ("shebang") support similar to Bash, Perl, or Python. This submission demonstrates how to set this up using only about 20 lines of bash (and a small mex program written in C).

To minimize execution time of each #! script, the provided Bash script establishes a background session of Matlab and re-uses this session as needed.

Please see "readme.html" for installation and comments.

Cite As

Joshua Dillon (2024). Matlab Daemon (https://www.mathworks.com/matlabcentral/fileexchange/30120-matlab-daemon), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

Updated documentation.

1.0.0.0