Filter löschen
Filter löschen

When to use mex files?

1 Ansicht (letzte 30 Tage)
Nicholas
Nicholas am 16 Jul. 2014
Beantwortet: James Tursa am 16 Jul. 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...

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by