How to make my Simulink program with m-code run faster
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
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?
0 个评论
回答(1 个)
Walter Roberson
2015-12-7
0 个投票
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.
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!