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)

Answers (1)

Use MATLABFunctionConfiguration and modify the FunctionScript property.

2 Comments

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?

Sign in to comment.

Categories

Products

Asked:

on 3 Oct 2023

Commented:

on 3 Oct 2023

Community Treasure Hunt

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

Start Hunting!