How do I copy 2 .slx in 1 .slx ?
조회 수: 5 (최근 30일)
이전 댓글 표시
I need to bring 2 different models into a new single .slx. How can I do it using a script?
댓글 수: 0
답변 (1개)
Fangjun Jiang
2022년 9월 20일
The best way is to use model reference. Add two "Model" blocks, each specified as reference to m1.slx and m2.slx
The other way is just to copy the contents.
new_system()
add_block()
set_param()
Simulink.SubSystem.copyContentsToBlockDiagram(subsys,sys)
Simulink.BlockDiagram.copyContentsToSubsystem(sys,subsys)
save_system()
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!