Is there a way to get MATLAB Function name defined in Simulink block programmatically ?
이전 댓글 표시
- I would like to know whether the MATLAB Function block created in Simulink can be programatically check or parameters of the function can be obtained.
- For example
y = fcn(u) or y = FunctionName(u)
I would like to get the function name fcn or FunctionName
댓글 수: 2
Steven Lord
2023년 2월 1일
How are you hoping to use this information if it's available? What are you planning to use it for?
Shiva Haresh
2023년 2월 1일
채택된 답변
추가 답변 (1개)
Fangjun Jiang
2023년 2월 1일
1 개 추천
myconfig = get_param(gcb, 'MATLABFunctionConfiguration') and parse the text, you might be able to get it.
web(fullfile(docroot, 'simulink/slref/simulink.matlabfunction.matlabfunctionconfiguration.html'))
댓글 수: 4
Shiva Haresh
2023년 2월 1일
Fangjun Jiang
2023년 2월 1일
편집: Fangjun Jiang
2023년 2월 1일
You need to parse x.FunctionScript
The function name shows up on the icon and it changes as the user changes the function name. So I think it's already been parsed but I couldn't find it through block properties or 'MATLABFunctionConfiguration'
Shiva Haresh
2023년 2월 1일
Shiva Haresh
2023년 2월 2일
카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!