control parameters of a simulink block
1 次查看(过去 30 天)
显示 更早的评论
Hi,
Is it possible to control parameters of a simulink block with another block? Say create a block which controls the 'seed' value of 'Random Number Generator'.
Thanks Senmeis
0 个评论
采纳的回答
Kaustubha Govind
2012-8-27
In general, this is not a supported workflow, please see How Do I Change a Block Parameter Based on the Output of Another Block? The suggested solution would be re-implement the block so that the parameter value is accepted via an input port.
0 个评论
更多回答(2 个)
Ryan G
2012-8-27
You can do this by utilizing a MATLAB function that can call the set_param command. You may be able to use the interpreted MATLAB function which would be similar but I never tested it for set_param.
However, you cannot change the seed of the random number generator during simulation as it is not tunable during simulation.
0 个评论
Owen
2012-8-28
2 个评论
Kaustubha Govind
2012-8-29
Owen: I see. Your question threw me off: "Is it possible to control parameters of a simulink block with another block?" - suggests that you want to control parameters based on the output of another block.
If you simply need to control parameters before running the model, please follow TAB's suggestion.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!