Export sldd to base workspace and get all entries

61 visualizaciones (últimos 30 días)
Vinit
Vinit el 28 de Oct. de 2016
Comentada: Sabarirajan el 19 de Jul. de 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

Respuestas (1)

Donn Shull
Donn Shull el 10 de Ag. de 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 comentario
Sabarirajan
Sabarirajan el 19 de Jul. de 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)

Iniciar sesión para comentar.

Categorías

Más información sobre Manage Design Data en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by