reading .mat file

1 回表示 (過去 30 日間)
muhammad
muhammad 2011 年 2 月 20 日
hi guys i have saved many arrays in different .mat files like samp1.mat samp2.mat
now i want my problem to open a gui just like when u use uigetfile . i choose my specific sample .mat file and load the specific array in workspace variable i specified pls if anyone can help out . regards
  1 件のコメント
Jan
Jan 2011 年 2 月 20 日
You forgot to ask a question.

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 2 月 20 日
Construct a uicontrol that is either a popup or list box. Set the String value to a cell array of strings, each entry of which contains one line to be displayed in the uicontrol. In the callback for the control, get() the String property of the control and store that for a moment, and get() the Value property of the control and use that to {} index the string property. The result will be the file name you want to load. Use the functional form of load() to load it, such as
indata = load(Filename);
and then the fields of indata will be the variables saved in the .mat file.
The hardest part is next: getting the value you loaded out of the callback and in to a place you can use it. For that, see this FAQ

カテゴリ

Help Center および File ExchangeVariables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by