フィルターのクリア

IMPORTA DATA from .mat file in SIMULINK uisng GUI

2 ビュー (過去 30 日間)
Sindia Casado
Sindia Casado 2012 年 9 月 7 日
Hello everybody!
I am new to Matlab GUI and i would appreciate help for the work I am doing. Basically, my main problem is the following. I want to simulate a model in simulink. One of the inputs is a .mat file. I want to control the simulation of this model using GUI. However I am facing one big problem that I cannot solve. I have to introduce the .mat file before the simulation. I use the command uigetfile in order to open and select the file. The problem is how i can link that in Simulink and in the Gui editor in order to load the file in the model and finally finish the simulation.
Thank you in advanced
Sindia

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 9 月 7 日
編集済み: Azzi Abdelmalek 2012 年 9 月 7 日
%In your simulink model
  1. right click on your model then click "model properties"
  2. click "callbacks"
  3. click InitFcn
  4. write the code: load YourMatFile
%in your GUI before the simulation, you put your data in the file: YourMatFile

その他の回答 (1 件)

Sindia Casado
Sindia Casado 2012 年 9 月 10 日
Thank you very much for your help!

カテゴリ

Help Center および File ExchangeModel, Block, and Port Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by