Comment out block vs grounding signal

2 views (last 30 days)
Nishant Bhanot
Nishant Bhanot on 5 Dec 2017
Answered: Sebastian Castro on 26 Jan 2018
Is there a computational difference / simulation performance difference between commenting a block out vs grounding the signal of that block? I am working with a huge model with hundreds of bus signals which are used by referenced subsystems based on which version of the referenced subsystem is being called for that particular simulation. Will there be any performance benefits of commenting out signals as right now I ground the bus signals I do not use. If the difference is marginal how big does the model need to be to start finding measurable performance difference of using one method over the other? Thanks

Answers (1)

Sebastian Castro
Sebastian Castro on 26 Jan 2018
As far as I know, I don't think there is a difference.
In both cases, any block optimizations at code generation will remove unnecessary calculations that lead to grounds/commented-out blocks.
The best way to find out, though, is to try it yourself and look at the generated code :)
- Sebastian

Products

Community Treasure Hunt

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

Start Hunting!