필터 지우기
필터 지우기

Saving data in Model Workspace

조회 수: 2 (최근 30일)
Deepak
Deepak 2012년 2월 10일
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.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2012년 2월 10일
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.

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by