Calling out array from workspace in simulink

조회 수: 2 (최근 30일)
Nurul Ashikin Suhaimi
Nurul Ashikin Suhaimi 2021년 4월 13일
답변: Fangjun Jiang 2021년 4월 13일
Hi
I have an array in matlab workspace that i would like to use its values into a simulink.
For example in my matlab workspace, the values of array are [1 2 3 4 5]
How do I call out these numbers to connect directly to an if-else switch for decision making purposes.
Please help as I am unable to use constant blocks for this project.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2021년 4월 13일
You have "Var=1:5" in MATLAB base workspace. In Simulink, use a Constant block, specify its value as "Var", or "Var(1)", "Var(5)", etc.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Create Large-Scale Model Components에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by