Filter löschen
Filter löschen

Export sldd to base workspace and get all entries

68 Ansichten (letzte 30 Tage)
Vinit
Vinit am 28 Okt. 2016
Kommentiert: Sabarirajan am 19 Jul. 2020
Hello, How to export entries present in simulink data dictionary to base workspace or in var in 2016 version following code is working for 2014
hDict = Simulink.dd.open([dict_name,'.sldd']);
childNamesList = hDict.getChildNames('Global');
for n = 1:numel(childNamesList)
assignin('base',childNamesList{n},hDict.getEntry(['Global.',childNamesList{n}]));
end

Antworten (1)

Donn Shull
Donn Shull am 10 Aug. 2017
The method you show for 2014 uses an undocumented internal API which is subject to change without notice. Beginning with release R2015a there is a documented API for accessing Simulink Data Dictionaries. One way to implement the code you have shown using the documented API would be:
hDict = Simulink.data.dictionary.open([dict_name,'.sldd']);
hDesignData = hDict.getSection('Global');
childNamesList = hDesignData.evalin('who');
for n = 1:numel(childNamesList)
hEntry = hDesignData.getEntry(childNamesList{n});
assignin('base', hEntry.Name, hEntry.getValue);
end
  1 Kommentar
Sabarirajan
Sabarirajan am 19 Jul. 2020
I want to export SLDD to Excel, is there any way ?
How to get the Object class type (prameter / Simulink) for workspace or from SLDD (Object)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Manage Design Data finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by