Build a mex file from a complicated m-file.

1 visualizzazione (ultimi 30 giorni)
I have a heavy m-file with around 50,000 lines (~5000 kb). I need to call this function hundreds of times and each function call takes a few seconds. I tried to convert this function into a mex file to reduce computing time, but I am not quite sure whether codegen supports conversion of such a large script. Any comment is welcomed!
Jongwoo

Risposta accettata

Walter Roberson
Walter Roberson il 24 Lug 2015
I wouldn't recommend that to start. Altering code properly for code generation takes a fair bit of time. It would be more productive to profile the code first, find out where the slow parts of it are and see if you can recode them, possibly including moving just the slowest parts to mex.
  5 Commenti
Jongwoo Lee
Jongwoo Lee il 29 Lug 2015
I don't see .mexw64 file in the directory. I see error: "error building mex function" in the error report, without any details. I will try your suggestions and give feedback here. Thank you!
Ryan Livingston
Ryan Livingston il 29 Lug 2015
In the report, you can click on the "Build Log" tab. It should show any compiler errors if that is where the error happened.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Build Configuration in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by