Change content of Simulink Matlab Function block through console

2 views (last 30 days)
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)

Paul
Paul on 3 Oct 2023
Use MATLABFunctionConfiguration and modify the FunctionScript property.
  2 Comments
Munich Tech
Munich Tech on 3 Oct 2023
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

Find more on Simulink Functions in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!