MATLAB: Setting parameters of a certain block

blockrelaysetting

In my model …i have a constant block feeding a summer …i want the same value given in the constant block to be used as the switch on and switch off point value in a relay block…
How can i do it???

Best Answer

  • If you wanna change this offline you can use get_param and set_param commands to attain the value from the Constant block and set it for the Relay block. If you would like this to also update during simulation you would need to create a MATLAB S-Function for that. You can find an example for this here: