reading .mat file

1 visualización (últimos 30 días)
muhammad
muhammad el 20 de Feb. de 2011
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 comentario
Jan
Jan el 20 de Feb. de 2011
You forgot to ask a question.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 20 de Feb. de 2011
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

Categorías

Más información sobre Variables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by