defining simulink variables through matlab srcript

1 Ansicht (letzte 30 Tage)
Ajith Thomas
Ajith Thomas am 29 Okt. 2019
Kommentiert: galaxy am 30 Okt. 2019
how can I define variables through matlab script? I am using trial version

Antworten (1)

galaxy
galaxy am 29 Okt. 2019
You can create variables to workspace and in simulink, enable acess to base workspace.
For create variables via script, let 's try as following
v = genvarname('name_variable', who);
eval([v '= 1']); %% assign variable value
  2 Kommentare
Ajith Thomas
Ajith Thomas am 29 Okt. 2019
defined variable in matlab script is not loading to simulink model. this is the issue which i am facing
galaxy
galaxy am 30 Okt. 2019
You must using "name_variable" in simulink model which same as workspace, and in model, please acess to base workspace as following
2.PNG

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by