Passing values from Matlab to Simulink

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?

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2021년 4월 26일

0 개 추천

Start a new model, drag a Constant block and Display block. Connect them, specify the Constant value as T and simulate.

댓글 수: 1

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]

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

제품

질문:

2021년 4월 26일

댓글:

2021년 4월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by