Is it possible to use "add_line()" betwen "Model Reference" Blocks
4 次查看(过去 30 天)
显示 更早的评论
Hello !
I have a System with several "Model Reference" Blocks which have many in and out ports and i'm trying to connect each outport with its same name inport.
But when i try :
add_line(system, Model Name/Outport Name, Model Name/Inport Name);
it returns me an error.
How can i do this ?
Thanks for helping !
0 个评论
回答(1 个)
Arvind Sathyanarayanan
2019-6-26
编辑:Arvind Sathyanarayanan
2019-6-27
Lucas,
Your command should be:
%Syntax: add_line('system_name', 'blockname/outport', 'blockname/inport');
add_line(gcs, 'Model/1','Model1/1');
6 个评论
Arvind Sathyanarayanan
2019-6-28
Can you please post of a screenshot of your actual model so I can better understand what you're trying to do?
Regarding your second comment, you need to load the system before you can use api commands. Try:
load_system('Model Reference Name');
find_system('Model Reference Name', 'BlockType', 'Inport');
另请参阅
类别
在 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!