How to use input signals as variables in Simulink blocks?
110 次查看(过去 30 天)
显示 更早的评论
How can I use an input signal as a variable for one of the block parameters of a block, such as the Slope or Initial Value for a Ramp block? The ramp is just an example, as I would like to apply this to other blocks as well. Thanks!
0 个评论
回答(2 个)
Rishabh Rathore
2018-5-24
oh, you want use input signals as values for parameter? I'm afraid that's not possible. Signals and parameters are two different things altogether. It is possible to use signal to specify number of input ports for blocks like multiport switch, but in general you cannot use signals as values for parameters.
0 个评论
Rishabh Rathore
2018-5-23
Here's what I understand from you question, you want to use variables as input/parameters not constants.
So the way you can do this is define the parameter in workspace of matlab and use that variable instead of the constant values as parameter.
Steps required:-
- Define the variable for parameter in workspace
- double click the block to open parameter dialogue box
- use the variable name defined in the workspace for the relevant parameter.
Note:- Make sure that the variable get initialized/assigned before it's been used.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!