Is there a way to pass the name of an input signal to a matlab function block in simulink?
1 次查看(过去 30 天)
显示 更早的评论
Dear community,
i have a question: Is there a way to pass the name of an input signal to a matlab function block in simulink? If so, how does it work?
Thanks for your help!
Tom
0 个评论
回答(1 个)
Fangjun Jiang
2022-8-9
Not through passing but you can get it through get_param(). Note that some functions are not supported for code generation.
function y = fcn(u,x)
coder.extrinsic('gcb');
coder.extrinsic('get_param');
in=get_param(gcb,'InputSignalNames');
disp(in);
y = u;
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!