How to modify MATLAB Block "Data Type" parameters from a script?

I'm trying to write a Function which accepts some parameters and opens, unlocks, creates a MATLAB Function Block in a Library, populates it with MATLAB Code and locks it again.
My current function already does almost everything and is mostly based on this example:
For the uses of my Blocks and the whole use of automatizing this process, I don't want to go every time to the library, unlock it and specify the Ports and Data Manager parameters for input and output of the functions, as it automatically gets as "Size: -1" and for the Type "Inherit: Same as Simulink". Is there a way to specify these parameters that are available through "Data Types" inside the MATLAB Function Block programatically?
I plan to expand this script and let it do these changes later from a GUI. So any comments and tips are helpful. Thanks in advance!

1 Kommentar

Update: after reading and modifying the code from the next example:
I am able to set the data type succesfully. For the Size I still am not finding the correct Property of the Stateflow Data.
If I write A.outputs(1).Size I get "Unrecognized property 'Size' for class 'Stateflow.Data'."
Is there any way I can achieve to modify it without using the GUI?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

0 Stimmen

I found it. The property is called "Props.Array.Size" Hopefully this helps someone in the future.

Weitere Antworten (0)

Kategorien

Produkte

Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by