How to get the name of the input signal in a matlab function (simulink block)
7 次查看(过去 30 天)
显示 更早的评论
Dear community,
i wondering if there is a way to get the name of the input signal of a "matlab function"-block.
That´s what my model looks like:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1073805/image.png)
I already tried the get_param(u,...) to get the signal name but it didn´t work as the following error occurs: "Function 'get_param' not supported for code generation."
Is there any way to solve this?
Thanks for your help!
0 个评论
回答(1 个)
Walter Roberson
2022-7-22
编辑:Walter Roberson
2022-7-22
If you are still trying to do that testing about nan, remember that code cannot do dynamic fieldname access in generated code; https://www.mathworks.com/matlabcentral/answers/506792-is-it-possible-to-access-struct-fields-dynamically-in-generated-code#answer_416689
so even if you can get the signal names in generated code, you cannot loop over the names in generated code to test the bus elements by name.
4 个评论
Walter Roberson
2022-7-22
I do not know, sorry. Material I found earlier implied that in compiled code, the signal names are not available.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!