I have made a plain Simulink model consisting of Current Sensor/Scope/Switch etc. There are also two subsystems (Load and Battery) that are user defined Library objects. Links looks fine. The model works and simulation results are correct. Now I want to programmatically (from Matlab command window) change the Library objects. Say from Load_RLC to Load_R. Both exists as Library objects. I have tried commandos like: open_system('LowVoltageSystem') add_block('Load_R','LowVoltageSystem') pos=get_param('Load_RLC/LowVoltageSystem,'position') delete_block('Load_RLC/LowVoltageSystem’) set_param('Load_R','position',pos) But the ‘Load_R’ can not be found (There is no block named 'Load_R') I have also tried things like: replace_block('LowVoltageSystem,'Load_RLC','Load_R') Here the ‘Load_R’ is invalid block type.(Invalid NewBlock (
Kshitij Singh answered .
2025-11-20