4

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?

romeovs
  • 309

1 Answers1

1

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.

Gareth
  • 19,080
Hello71
  • 8,673
  • 5
  • 42
  • 45