Raul
Raul

Reputation: 33

Change name to S-Function Level 2 programmatically

I have a S-Function level 2 and i want to change his name.

enter image description here

I want to change that "mfile" from this image with something else, I want to make that with code in a function. I have a S Function and some inputs and some outputs generated programmatically and I don't know how to change that name with code. I try set_param but no success.

How to change S-Function name programmatically in a function ?

Upvotes: 2

Views: 274

Answers (1)

Navan
Navan

Reputation: 4477

You use set_param to change the FunctionName parameter of that block.

set_param(blk, 'FunctionName', 'new_mfile');

where blk is the full path of the block, which can be obtained by gcb if the block is selected. 'new_mfile' is the name of your generated MATLAB file.

Upvotes: 2

Related Questions