How do I copy 2 .slx in 1 .slx ?

5 visualizaciones (últimos 30 días)
Matheus
Matheus el 20 de Sept. de 2022
Respondida: Fangjun Jiang el 20 de Sept. de 2022
I need to bring 2 different models into a new single .slx. How can I do it using a script?

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 20 de Sept. de 2022
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()

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by