Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Compile (.m) files to a buildin function
Posted:
Dec 13, 2012 9:47 AM


"Ricardo " <venanciopereira@live.com.pt> wrote in message news:kacbt0$kpr$1@newscl01ah.mathworks.com... > Hello everybody > > Is there any way to compile a function (.m) in order to optimize its > performance?
That's a difficult question.
> I don't know if you understand what I mean, but most of the functions of > Matlab are compiled and others not (for example, I think "rand" is a > compiled function but "randint" not). What I was wondering is if you can > build new (.m) functions to make them efficient, such the example of > "rand" function?
The only way you can create new builtin functions in the style of RAND is to get a job at MathWorks.
http://www.mathworks.com/company/jobs/opportunities/
Depending on what exactly you're trying to do, creating a C++ MEXfile manually, preparsing the function using PCODE, or generating C/C++ code using MATLAB Coder and using that as the core of a MEXfile may be options. Alternately, identifying bottlenecks in the code using MATLAB Profiler and places where you may be able to implement your algorithm more efficiently with Code Analyzer may be sufficient to improve performance until it meets your needs.
http://www.mathworks.com/help/matlab/codeperformance.html
 Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com



