Filter löschen
Filter löschen

Saving data in Model Workspace

2 Ansichten (letzte 30 Tage)
Deepak
Deepak am 10 Feb. 2012
Hello, I wish to save some variables in Model Workspace Programatically. I am currently using Matlab 2009b. Unfortunately the help files are not too clear on this subject. My problem is that I create several hundred parameters in the Matlab base workspace using a textread function. In order to avoid cluttering the base workspace I wish to execute function directly in the model when it is opened and load all the parameters directly in the Model Workspace. So for example currently I follow the following steps. 1. Run function ImportTextFile , this loads the parameters in Matlabworkspace. 2. Open Model and simulate. The problem is that the Simulink Model is standardised for several variants and the ImportTextFile is used only in some special cases. So I wish to change the model file programatically so that only in the special cases it will use ImportTextFile directly to load the parameters in ModelWorkspace. Could someone advice how this could be done. Any help will be appreciated. Thanks.

Antworten (1)

Kaustubha Govind
Kaustubha Govind am 10 Feb. 2012
See the Using MATLAB Commands to Change Workspace Data section. You should be able to set the Data Source to 'MATLAB File' or 'MATLAB Code' to load your parameters using ImportTextFile.

Kategorien

Mehr zu Modeling 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