Effect of using masked subsystem on simulation speed?

Hello In my simulink model I am using a number of masked blocks. Each block based on their parameter and connection modifies itself. I want to know that how the simulation speed can be affected by using such masked subsystem inside the model.
Thanks

 Accepted Answer

AFAIK, the only effect of masks on simulation performance is that at initialization time, block dialog parameters are first evaluated in the mask workspace (if using mask workspace variables in the dialog). Initialization happens once at the start of simulation time and every time you Update Diagram (Ctrl+D) during simulation.
Are you seeing any runtime overhead?

4 Comments

Hi Kaustubha... Yes In my simulink model, I have modified the subsystems and wrote initialization for the subsystem so that they can modify themselves based on the connected blocks. I have used some Goto-From (with global scope) blocks as well instead of feeding the signals directly. Now simulink model takes much longer time than earlier.
I guess Goto-From blocks are just the virtual connections and they should not affect the simulation time needed, Am I right?
Thanks...
Jagmohan: When you say Simulink takes much longer than before, how are you separating the initialization time from the runtime (they happen together every time you run the model)? You could try using Simulink Profiler to verify if its just the initialization time that has increased or even the running time.
Actually initialization time is very less compared to run time in my case. So I could see it is the simulation time. Here I applogize for my mistake that I didn't look at the s-function properly in both cases. it was the matlab s-funtion in one case and C-Mex in another case. Now I have converted it into C-Mex now I see simulation time is of the same order for both the cases.
Great! Glad you were able to find the answer.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!