MATLAB: Does using a XY Scope block slow down the execution of the model in Simulink 7.4 (R2009b)

simulink

I have a simple model in Simulink. When I add a XY Scope block to visualize, the simulation speed slows down notably.

Best Answer

The ability to execute the XY Scopes faster is not available in Simulink 7.4 (R2009b). The reason is that the XY Graph block is a M S-Function block. Its execution methods are written in MATLAB code that are interpreted to execute and consequently takes more time to execute. It also updates the plot every time it is executed which further slows it down.
To workaround this issue, you can to set a slower sample time for the XY Scope block which will reduce the number of its executions and hence speeding up the model.