How to programmatically change the name of a S-function

5 views (last 30 days)
Hello,
I am developing a Matlab script which programmatically creates a Simulink model. In this Simulink model I'm using a library of a block which includes a S-function, and I'd like to be able to programmatically change the name of the S-function.
I've tried to use set_param, but unfortunately I haven't figured out how to change the name. I can do it manually, but as this library block will be used for hundreds of times in my Simulink model, manual editing becomes completely inefficient.
Any ideas?

Answers (1)

Fangjun Jiang
Fangjun Jiang on 22 Aug 2016
I tried and it seemed working.
set_param(BlockPath,'FunctionName','NewS_Function');

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!