add_line or connect or other commands.
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
baocheng guo
am 4 Apr. 2015
Beantwortet: Srikanth Mohan
am 29 Okt. 2021
Hi All,
This might be a simple question but...
I am simulation a rotating machine use the equivalent circuit, and the case has so many resistance to connect different style at each step, so I am trying to connect the up RLC block to the down RLC block (shown in figure) using the "add_line" command.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148669/image.png)
I have been trying the following line but keep running into an error: add_line('mySys','Ru1/2', 'Rd/1', 'autorouting', 'on')
Error: "Invalid Simulink object name: Ru1/2"
Now both of these ports are different than typical ports. Visually, they are little black circles. Do I need to change the way I identify these types of ports for some reason?
Or, should I have other commands to fix it?
Appreciate any help!!
Thanks!
0 Kommentare
Akzeptierte Antwort
TAB
am 6 Apr. 2015
Bearbeitet: TAB
am 6 Apr. 2015
Check if there is any leading or trailing space in block names and remove the spaces.
If still not working (mysteries Matlab & Simulink...!!!) then try to connect the line using port handles.
SrcBlkH = get_param('mySys/Ru1', 'PortHandles');
DstBlkH = get_param('mySys/Rd1', 'PortHandles');
add_line('mySys', SrcBlkH.Outport(1), DstBlkH.Inport(1), 'autorouting', 'on');
Weitere Antworten (1)
Srikanth Mohan
am 29 Okt. 2021
I have a similar problem, except that the error message is different.
When I use the following command
add_line(bdroot,srcport.Outport(1),destport.Inport(1), 'autorouting', 'smart')
I get the error message
"The port handle does not belong to any object within the system 'my_system'."
I have no clue which port handle and which system.
I appreciate any form of help.
Thank you.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Composite Components finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!