I have block handles and pathnames but delete_line function always gives the error of : "Invalid Simulink object handle". I mean I get handles and pathnames with "get_param" function so there should be no way of being them invalid.
I may be doing mistakes with using dots, paranthesis and brackets but matlab should give that error first, anyways here are my codes;
BlockHandle = get_param('DL/Subsystem/Subsystem', 'Handle');
Port = get_param('DL/Subsystem/Mux', 'PortConnectivity');
SourceHandle = get_param(Port(1,1).SrcBlock, 'Handle')
delete_line = ('DL', 'Subsystem/1' , 'Mux/1')
delete_line = ('DL', (SourceHandle)/1, 'Mux/1 % Error : Invalid Simulink obejct handle.
k = get_param(SourceHandle, 'Ports')
PortHandle = get_param(k(1), 'Handle')
I could'nt figure out how to do this. "Name/PortNumber" works but I have the same name repeatedly.. So I need to use handle or pathname, I tried pathname it is not happening neither.
I think there might be a mistake I do with brackets or dots while using delete_line.