|
"Pat Finder" <thomas@netacc.net> wrote in message
news:ktcefb$2e3$1@newscl01ah.mathworks.com...
> I have three matlab files that run, and test all possible combinations of
> several parameters.
> (Yes, I need to test all combinations to validate my thesis work.)
>
> I am running 2011b on MacOSX/64 bit.
>
> I know that there are several compilation options: mex files, generating C
> code, deploying applications, and probably others.
>
> I am considering something along the lines of:
> 1. Converting the *.m file into *.cc files. (Two are Matlab classes, one
> is the main.)
> 2. Compiling them for optimization.
> 3. Linking the mess together.
>
> I've heard that this might not actually make the code run any faster
> because if you aren't careful you generate the byte codes that are
> interpreted by the Matlab runtime.
MATLAB Compiler generates applications that use the MATLAB Common Runtime
(MCR) to execute code "as though" you were running it in MATLAB.
MATLAB Coder can generate standalone C or C++ code from a subset of the
MATLAB language. Neither MATLAB Compiler nor MATLAB Coder support all of the
MATLAB language and all the toolboxes, but MATLAB Compiler supports more
than MATLAB Coder does.
> Questions:
> 1. Can I save time or not by converting the Matlab objects to C++?
It depends on what you're doing. If you're using something that's not
supported by either MATLAB Compiler or MATLAB Coder (like symbolic
calculations using Symbolic Math Toolbox) then probably not. [Symbolic Math
Toolbox DOES have a function to convert individual symbolic expressions into
C code, CCODE, but you couldn't just throw a MATLAB program file into CCODE
and say "Generate this." It's more 'targeted' in a sense.]
> 2. Does anyone have any recommendations for paths through mcc to do this
> on Mac OSX/64 bit?
Before trying this, I recommend:
1) Using MATLAB Profiler to determine where the bottlenecks in your code
(for a smaller subset of your parameter sweep) are located and see if you
can optimize those bottlenecks.
2) Once you've identified the bottlenecks, if you can't figure out how to
improve their performance, describe what you're doing and show the group
some code. There are a lot of people here who enjoy "MATLAB golf" and
"MATLAB code racing" (making MATLAB code short and fast respectively.)
--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
|