Programmatically open ModelExplorer with a data dictionary entry selected?

조회 수: 5 (최근 30일)
John Harris
John Harris 2018년 4월 18일
답변: Yash 2024년 8월 30일
A custom library block I am working with has a simulink.bus coming out of an enabled subsystem. I want to initialize the bus data until the subsystem is enabled and producing its own data. I can do that using the enabled subsystem's outport, but I need to create an IC struct.
So, I am writing a function that will automate some of the process: creating the struct with Simulink.Bus.createMATLABStruct, and storing it in the model's data dictionary using assignin()
I don't have a list of initial values; the modelers will need to supply their own. To make this easier, I want to open the model explorer with the data dictionary open and the new struct selected. Is there any way to do this programmatically?

답변 (1개)

Yash
Yash 2024년 8월 30일
Hi John,
There are multiple ways to open a data dictionary in model explorer programatically and show its content. However, please note that these methods don't select a particular variable after opening the data dictionary. Please refer to the below methods:
These methods will open the data dictionary in the model explorer. Please refer to the below MATLAB Answer thread to check how to close the Model Explorer: https://www.mathworks.com/matlabcentral/answers/6375-help-matlab-command-to-close-model-explorer
I was unable to find any way which can select a specific variable in the model explorer. I hope this information helps you in implementing your code.

카테고리

Help CenterFile Exchange에서 Manage Design Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by