Azzera filtri
Azzera filtri

When to use mex files?

1 visualizzazione (ultimi 30 giorni)
Nicholas
Nicholas il 16 Lug 2014
Risposto: James Tursa il 16 Lug 2014
I was given a lot of .m files that, together, run a single program. What files should I convert to me in order to speed it up? Is there way to run a test on the program to see where it bottlenecks? I'm new to C, Matlab, and the use of mex funcitons...

Risposta accettata

James Tursa
James Tursa il 16 Lug 2014
First thing to do is use the profiler and let MATLAB tell you where it is spending most of the time. Then you can decide on what parts of the code to speed up. Often, there are MATLAB m-code changes that can accomplish the speed up. Only after that has been vetted should mex files be considered, and even then you should have a clear idea of why the mex version of the code will be faster (avoiding data copying, etc). Depending on your version of MATLAB, the profiler is invoked differently. Look for a button at the top for "Profile" or "Run and Time" or something similar. And you can type in "doc profile" to read on on what profiling will do for you. E.g., see here:

Più risposte (0)

Categorie

Scopri di più su MATLAB Compiler in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by