Assign workspace variable during runtime

조회 수: 4 (최근 30일)
Thomas Schütz
Thomas Schütz 2020년 10월 28일
답변: Rishabh Mishra 2020년 11월 4일
Hello everybody,
I want to change a Variable from Simulink Workspace during runtime through a Matlab function. Does anyone know how to implement this ?
Thanks in advance,
Thomas
  댓글 수: 2
Fangjun Jiang
Fangjun Jiang 2020년 10월 28일
What do you mean by "Simulink Workspace"?
Thomas Schütz
Thomas Schütz 2020년 10월 28일
The Simulink Model Explorer. I assigned my variable in the Model Workspace.

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

답변 (1개)

Rishabh Mishra
Rishabh Mishra 2020년 11월 4일
Hi,
You may use the MATLAB Function Block available in Simulink. Double click on the scenario canvas and type ‘MATLAB Function’ and then select the first block in the search list. On double clicking on the MATLAB Function Block, you can define the required function in MATLAB script editor.
Use the 'Constant block' in Simulink with it's value as workspace variable along with the MATLAB Function block to process the workspace variable during simulation runtime.
For better understanding of the MATLAB function block, refer the following link:
Hope this helps.

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by