Hi,
I have a large model and I am using the Simulink profiler to find out what blocks are taking my model a long time to run. The profiler tells me that the Embedded Matlab blocks are taking up most of the run time. Normally, we run the model in Rapid Accelerator mode, but the profiler requires that we use Accelerator mode. What is the difference in the way that Simulink handles Embedded Matlab blocks in Accelerator vs Rapid Accelerator Mode? I want to know if these Embedded Matlab blocks are still what is taking the longest time when I run in Rapid Accelerator mode.
I made a simple model with an Embedded Matlab block and ran it in Accelerator and Rapid Accelerator modes then tried looking at the model.c file that is generated with each. It looks like with Rapid Accelerator it inlines the Embedded Matlab code, but with Accelerator mode it creates an S-function. Is the S-function a level 2 m-file S-function? If that is the case it is not surprising that these blocks take the longest time because they are interpreted. If they are level-2 m-file S-functions, is there any way I can tell the model to make C S-functions when running in Accelerator mode?
Finally, is there a way to manually profile the code when running in Rapid Accelerator? I am thinking of something similar to putting tic and toc calls before and after a block. Any help is appreciated. Thanks.
Best Answer