Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Compile (.m) files to a build-in function
Replies: 3   Last Post: Dec 13, 2012 11:59 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: Compile (.m) files to a build-in function
Posted: Dec 13, 2012 9:47 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"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 built-in 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++ MEX-file
manually, preparsing the function using PCODE, or generating C/C++ code
using MATLAB Coder and using that as the core of a MEX-file 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/code-performance.html

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.