Passing values from Matlab to Simulink
14 次查看(过去 30 天)
显示 更早的评论
Hi,
I am trying to assign a set of variables values in matlab, and then pull them through into Simulink, but having problems getting the correct value.
For example, in Matlab i have defined a constant T such that
T = 0.2
In Simulink, i have then created a Constant block where the variable is T, but when i run the model i find that the Constanant block returns a value of 2 & 1, rather than the 0.5,
Can someone advise what i am doing wrong?
0 个评论
回答(1 个)
Fangjun Jiang
2021-4-26
Start a new model, drag a Constant block and Display block. Connect them, specify the Constant value as T and simulate.
另请参阅
类别
在 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!