How can I use variables defined MATLAB command window at MATLAB Function block at Simulink?

Example
MATLAB Command window >> aaa = 3;
MATLAB Function block at Simulink
function y = fcn(u)
%#codegen
c = aaa+u;
y = c
When I start simulation, Error message is announced at bellow.
関数または変数 'aaa' が未定義です。 (Function or Variable 'aaa' is not defined)

回答 (1 件)

Karin Ebenbeck
Karin Ebenbeck 2016 年 10 月 13 日

0 投票

My solution would be this:
create a script in MATLAB in which you define the variable aaa save this script - run it and then run SIMULINK

カテゴリ

質問済み:

2016 年 10 月 13 日

回答済み:

2016 年 10 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by