Borrar filtros
Borrar filtros

When to use mex files?

1 visualización (últimos 30 días)
Nicholas
Nicholas el 16 de Jul. de 2014
Respondida: James Tursa el 16 de Jul. de 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...

Respuesta aceptada

James Tursa
James Tursa el 16 de Jul. de 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:

Más respuestas (0)

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by