Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
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 comentario
Santiago Jose Flores Siguenza
Santiago Jose Flores Siguenza el 3 de Ag. de 2022
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?

Iniciar sesión para comentar.

Respuesta aceptada

Santiago Jose Flores Siguenza
Santiago Jose Flores Siguenza el 3 de Ag. de 2022
I found it. The property is called "Props.Array.Size" Hopefully this helps someone in the future.

Más respuestas (0)

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by