Effacer les filtres
Effacer les filtres

How to save dictionary to a mat file

8 vues (au cours des 30 derniers jours)
D Joseph
D Joseph le 28 Juil 2015
Commenté : D Joseph le 29 Juil 2015
I could not save dictionary to a mat file using Save Dict D,where Dict is the mat file and D is the dictionary
  2 commentaires
Walter Roberson
Walter Roberson le 28 Juil 2015
What happened when you tried?
Try
save('Dict.mat', 'D');
D Joseph
D Joseph le 29 Juil 2015
when the dictionary is stored as a mat file, first it cannot be stored. Later when it can be stored , it cannot be loaded into another file. When I'm trying to solve it into another .m file , error is shown . what to do to solve this problem.

Connectez-vous pour commenter.

Réponse acceptée

Sebastian Castro
Sebastian Castro le 28 Juil 2015
Modifié(e) : Sebastian Castro le 28 Juil 2015
I am assuming you're using a Simulink Data Dictionary in R2015a (which is when the official API for data dictionaries came out).
What you need to do is extract whichever of the 3 sections (Design Data, Configurations, and/or Other Data) you need. Then, you can use exportToFile as shown below:
>> d = Simulink.data.dictionary.open('dictionaryName.sldd');
>> data = getSection(d,'Design Data')
>> exportToFile(data,'Data.mat')
- Sebastian

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by