Can a parameter in the workspace use a type definition the Data Dictionary?

4 ビュー (過去 30 日間)
Izaak
Izaak 2023 年 9 月 18 日
回答済み: Dhruv 2023 年 9 月 21 日
Hi everyone,
I have tried to create a paramater in the workspace which makes use of a bus definition in the Data Dictionary. However, it does not seem that the workspace can "see" the dd by default and thus when trying to use the parameter, Matlab throws an error stating that the bus definition is undefined in the workspace.
Is there a way to set the workspace to have access to the dictionary? Essentially, to allow it to see and the use the definitions in it?

採用された回答

Dhruv
Dhruv 2023 年 9 月 21 日
I understand that you are trying to access the Data Dictionary from the base workspace through a parameter.
Data Dictionaries are designed to provide a centralized and controlled way to manage model-related data, and they operate independently of the base workspace.
As a workaround to your use case, I suggest you to:
  1. Export data from Data Dictionary: There are certain ways you can export the data dictionary and then use it in the base workspace, refer to the following link for detailed guidance: https://in.mathworks.com/help/releases/R2022b/simulink/ug/import-and-export-dictionary-data.html
  2. Make some variables access from workspace: You can employ variables in both the base workspace and the Data Dictionary simultaneously. Even when model is linked to Data Dictionary, you can use ‘evalin’ function to access variables which are defined in base workspace. You may want to refer to the documentation: https://in.mathworks.com/help/releases/R2022b/matlab/ref/evalin.html
I hope the above suggestions will help you in achieving your desired outcome!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by