Passing values from Matlab to Simulink

9 Ansichten (letzte 30 Tage)
Stephen Sommerville
Stephen Sommerville am 26 Apr. 2021
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?

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 26 Apr. 2021
Start a new model, drag a Constant block and Display block. Connect them, specify the Constant value as T and simulate.
  1 Kommentar
Stephen Sommerville
Stephen Sommerville am 27 Apr. 2021
Thanks for the answer - this is what i have been doing, but for some reason the value of T is not being brough through correctly, and it looks like the value of T is an array dimension i.e. [2 1]

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by