How can I use variables defined MATLAB command window at MATLAB Function block at Simulink?
3 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
回答(1 个)
Karin Ebenbeck
2016-10-13
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!