Borrar filtros
Borrar filtros

Change settings in model properties dialog box by matlab command

1 visualización (últimos 30 días)
Hello everyone, Currently I am working on Matlab 2014a and I am using Data dictionary in my model and hence in model properties dialog box (File-> Model Properties-> Model Properties -> Data Tab), Defined in Data Dictionary is selected (refer image)
I want to change this setting to Base workspace, through matlab command.
Can someone help in modifying this setting?

Respuesta aceptada

Sebastian Castro
Sebastian Castro el 21 de Abr. de 2015
You can use the following syntax:
To change to "Base Workspace": set_param(bdroot,'DataDictionary','');
To change to "Data Dictionary": set_param(bdroot,'DataDictionary','MyDictionaryName.sldd');
Here, bdroot refers to the active model. You could also use the actual model name as a character array, like 'UPA_Distance_Indication_Visual' .
- Sebastian

Más respuestas (2)

Arunkumar Muthukumaran
Arunkumar Muthukumaran el 21 de Abr. de 2015
Thanks Sebastian for the answer.
I have another question related to this. When I have Simulink model in a folder and its Data dictionary in another folder, how can I access the path of data dictionary? Is there any command available for accessing path of Data dictionary?
  1 comentario
Sebastian Castro
Sebastian Castro el 21 de Abr. de 2015
Editada: Sebastian Castro el 21 de Abr. de 2015
Absolutely. You can use the addpath function.
For example, you can create a script that adds your models and your data dictionaries to the MATLAB path:
addpath({'myFolder/models','myFolder/data'})
Once you do that, MATLAB will have all your necessary files added to the path. There's more advanced ways to manage all yo
- Sebastian

Iniciar sesión para comentar.


Arunkumar Muthukumaran
Arunkumar Muthukumaran el 21 de Abr. de 2015
I think my question was not clear. I dont want to add the path of my data dictionary to matlab path.
I already have a model that is linked to Data dictionary. But the model and data dictionary are in different folders. Hence I need to access the path of the data dictionary.
What I am trying to do is, to get data out of data dictionary. Since it is not the same working directory as my model, I need to somehow get the path where data dictionary is stored, so that I can use it to get data out of it.
Thanks for your replies :)
  1 comentario
Sebastian Castro
Sebastian Castro el 21 de Abr. de 2015
I see. You can use "which" to get the full path to things, assuming they are on your MATLAB path:
filePath = which('GlobalData.sldd')
Is that more like it?

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink Environment Customization 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