- get_param() and 'DialogParameters': https://www.mathworks.com/help/simulink/slref/get_param.html
- gcbh: https://www.mathworks.com/help/simulink/slref/gcbh.html
How to check accepted input data types programatically
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi! Some simulink blocks only accept signals of certain data types as input (either by default or by setting something like an inport or a bus creator to a certain data type).
I know I can find the accepted data types in the matlab documentation. I'm interested to know if I can find these programatically, if there is a function/property that I can use that would give me a list of all the possible signal data types that a block or input port of a block.
Thanks!
0 comentarios
Respuestas (1)
Amit Dhakite
el 17 de Mzo. de 2023
Hi Bogdan,
As per my understanding, you want to get the input data types a Simulink block can take, programmatically.
To get the details about any block, you have to focus it and write down the code shown below:
% For this case a gain block is considered
dlgParams = get_param(gcbh, 'DialogParameters');
disp(dlgParams.Gain.Validity.DataType);
For the gain block, the output is as follows:
Please note that the properties of different blocks may vary, not every block contains the "Gain" property.
For further information about the terms used above, kindly go through the following links:
0 comentarios
Ver también
Categorías
Más información sobre Programmatic Model Editing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!