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!