- 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
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Amit Dhakite
2023-3-17
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!