필터 지우기
필터 지우기

How to get the name of the input signal in a matlab function (simulink block)

조회 수: 7 (최근 30일)
Tom
Tom 2022년 7월 22일
댓글: Tom 2022년 7월 22일
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:
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!

답변 (1개)

Walter Roberson
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
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.
Tom
Tom 2022년 7월 22일
Thanks for your help. Maybe someone else finds a solution :)
Have a nice day!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by