Is there a way to get MATLAB Function name defined in Simulink block programmatically ?
Mostra commenti meno recenti
- 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 Commenti
Steven Lord
il 1 Feb 2023
How are you hoping to use this information if it's available? What are you planning to use it for?
Shiva Haresh
il 1 Feb 2023
Risposta accettata
Più risposte (1)
Fangjun Jiang
il 1 Feb 2023
1 voto
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 Commenti
Shiva Haresh
il 1 Feb 2023
Fangjun Jiang
il 1 Feb 2023
Modificato: Fangjun Jiang
il 1 Feb 2023
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
il 1 Feb 2023
Shiva Haresh
il 2 Feb 2023
Categorie
Scopri di più su Simulink in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!