How do i store Data types of Input and Outputs of a block in Simulink in a data dictionary ?

3 ビュー (過去 30 日間)
sachin narain
sachin narain 2019 年 1 月 24 日
回答済み: Rajanya 2025 年 2 月 12 日 9:58
I have created a Data Dictionary for a block model in Simulink ? I have an array where i have stored all the INouts and Outputs with the data types of each Input and Output.
I have used the addEntry(MyDictionaryObject ,Input_Output , DataTypes) , but this command gives me a data dictionary with the names( in one column i.e which is nothing but the 'Input_Output') and the value on the side as Data types .
I want to have the DataTypes in the Data types column in the data dictionary . IS there any command which i can use in script by which i put all the data types in the Dat types column in the dictionary.
Thank you in advance

回答 (1 件)

Rajanya
Rajanya 2025 年 2 月 12 日 9:58
You can achieve the same if the entries are provided as Simulink parameters, like:
parameter = Simulink.Parameter;
parameter.DataType = entryDataType; % entryDataType stores the required dataType for 'entryName'
addEntry(dictDesignDataObj, entryName, parameter); % added as a parameter obj (for 'entryName')
The following Inputs and Outputs, when added to a dictionary like above, alligns their data types in the respective column -
To know more about Simulink parameters, you can refer to its documentation page by executing the following from MATLAB Command Window -
doc Simulink.Parameter
Hope this answers. Thanks!

カテゴリ

Help Center および File ExchangeManage Design Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by