Effacer les filtres
Effacer les filtres

When to use mex files?

1 vue (au cours des 30 derniers jours)
Nicholas
Nicholas le 16 Juil 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...

Réponse acceptée

James Tursa
James Tursa le 16 Juil 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:

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by