Change content of Simulink Matlab Function block through console

First time Matlab Function block is created, it is populated with the following default implementation (one can use the editor to view and change it):
function y = fcn(u)
y = u;
Is there a way to use smth like get_param() and set_param() to change the content of this block? (I need to be able to modify function through console instead of Editor)

Réponses (1)

Paul
Paul le 3 Oct 2023
Use MATLABFunctionConfiguration and modify the FunctionScript property.

2 commentaires

Hey Paul,
Thanks for the reply. That is indeed the option that could work, but due to libraries compatibility, we are using Matlab 2018b. Do you have a solution for older Matlab version?
No, I'm afraid not.

Connectez-vous pour commenter.

Catégories

Produits

Commenté :

le 3 Oct 2023

Community Treasure Hunt

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

Start Hunting!

Translated by