How do I copy the ports of a Simulink model

4 views (last 30 days)
Hello, I want to copy the in/out ports of a Simulink model to another new Simulink model using a Matlab Script.
Basically, I want to open a model, view its ports, and copy ONLY those ports to another model which will be created in the same Matlab Script.

Answers (1)

Mark McBroom
Mark McBroom on 15 Mar 2018
Use find_system(), new_system(), add_block() and save_system()
  1 Comment
Laurentiu  Badea
Laurentiu Badea on 15 Mar 2018
Edited: Laurentiu Badea on 15 Mar 2018
Yes, but the problem is that I want to copy the ports from one system to another, without copying other blocks. The in/out ports are the only parts I'm interested in copying.

Sign in to comment.

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!