MATLAB: Can I use the value from a constant block as a defined input to another block

constantsimulink

Let's say I have 2 blocks, Constant and Random Integer Generator. Let's refer to the constant value as T. I want the Random Integer Generator to use T as the Sample time. How can I use this value at run time?

Best Answer

See the attached model. I used get_param command for this purpose. Just run the model, open the Scope at the end and see the results. You can change the Constant block value and observe the change accordingly.