How do I avoid variable (or file) name conflicts when using multiple copies of library subsystems with To Workspace (or To File) blocks?
Show older comments
I am creating a model and using a subsystem that I created and placed in a custom library. This subsystem has a To Workspace block in it that has the default variable name as 'simout'. Thus this block will save data to a variable named 'simout' in the MATLAB workspace.
The problem is that when I use two copies of this subsystem block, I now face a naming conflict as two blocks are trying to save data to the same variable. In order to change the variable name, I need to break the library link. However, I need to retain the library link as I need to make changes to the subsystem block.
The same issue arises if I have a To File sink block instead of a To Workspace block in my library subsystem.
Accepted Answer
More Answers (0)
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!