How to make my Simulink program with m-code run faster
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
In my simulink program I have a call to an m-file in an "interpreted matlab function". Calling this m-file takes a lot of time. Are there any faster ways to use the same code I'm using in the m-file. Just copy/paste of the code in a matlab (embedded) function didn't work for me. Are there any suggestions?
Réponses (1)
Walter Roberson
le 7 Déc 2015
0 votes
There are various techniques to optimize .m functions. You would usually start by profiling the code execution.
Generally for higher performance than that you would use an (embedded) MATLAB Function block, for which you would need to adapt the code. You can seldom simply copy and paste into such a block, but the work is not necessarily a lot more than adding hints about the expected matrix sizes and types. However, not all routines can be accelerated with such a block. A lot depends on your code. It is difficult to answer without seeing your code.
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!