Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use a lot of matlab to process data etc. Yet I find my workflow a bit of sluggish, so I was wondering if I could speed things up a little using makefiles.

What I would like to do is write an .m file which, when called, creates a file with all of my data output, so that I can use the data in other programs. I would like to add a line to my makefile then:

output.dat: input.dat process1.m process2.m
        $MATLABROOT/matlab -nodesktop -nosplash -r 'var1=process1;process2(var1);quit()'

yet it seems to me there base to be a better way. The problem here is that it takes a long while for matlab to start up, and it has to be started every time output.dat is regenerated (even when my actual matlab code didn't change).

Is there a way to easily get some sort of compiled matlab form of the .m files? Like one would have with a c++ file?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

MATLAB Compiler

mcc is the MATLAB command that invokes MATLAB Compiler. You can issue the mcc command either from the MATLAB command prompt (MATLAB mode) or the DOS or UNIX command line (standalone mode).

mcc prepares MATLAB file(s) for deployment outside of the MATLAB environment, generates wrapper files in C or C++, optionally builds standalone binary files, and writes any resulting files into the current folder, by default.

share|improve this answer
Could you please explain what this is and how it helps, instead of just dumping a link? –  nhinkle Dec 7 '11 at 1:41
@nhinkle: TBH, I was planning on just dumping a comment. –  Hello71 Dec 8 '11 at 2:26
gareth's edits made it much better, as an example of how you can turn a mere link into a decent answer. –  nhinkle Dec 8 '11 at 2:38
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.