How do I use the ADD_LINE command with SimMechanics blocks?
Show older comments
The ADD_LINE command can be used to connect Simulink blocks from the command line. However, this command basically assumes that there are 'output' ports and 'input' ports. In SimMechanics this is not the case, and specifying connections in the normal way does not work.
Accepted Answer
More Answers (1)
Steve Miller
on 1 Feb 2018
0 votes
We have posted an example on the MATLAB Central File Exchange that shows how to use MATLAB commands to add Simscape blocks and connect them.
To connect a block to an existing line, simply use add_line() to connect the new block to any of the ports that are already connected to that line. The above example connects the Solver Configuration block to two other blocks which are already connected.
Thanks,
--Steve
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!