Effacer les filtres
Effacer les filtres

How to extract a excel file to a GUI after the user chooses it on a popup menu?

3 vues (au cours des 30 derniers jours)
Inês Mendes
Inês Mendes le 19 Mai 2015
Hi guys,
I am working with GUI and i am struggling with extracting the data from some excel files onto the program.
I know how to extract it, but i am having some difficulties identifying the file.
The thing is: I have a pop up menu in which the user chooses which file he wants to study. Only after that choice will the program extract the data. I am not being able to do that .
Does anybody have a clue of how to solve this?
  1 commentaire
Joseph Cheng
Joseph Cheng le 19 Mai 2015
Modifié(e) : Joseph Cheng le 19 Mai 2015
is it a predefined list or a user chosen file using uigetfile()? what are the issues that you are not able do to it? what have you tried and what errors did you get. if you can extract the data (probably using xlsread or other similar function) you just need to swap out the path and filename.

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
Image Analyst le 19 Mai 2015
Load the files into a listbox, like this: http://www.mathworks.com/matlabcentral/fileexchange/24224-magic-matlab-generic-imaging-component. Then when the user clicks on the file, in the callback of either the "Analyze" button, or in the callback of the listbox itself, put code like this:
[numbers, strings, raw] = xlsread(fullFileName);
set(handles.uitable1, 'data', numbers);
The program shows you how to get fullFileName when the user clicks on a filename, and it already has a table on the figure for you to throw your Excel data into.

Community Treasure Hunt

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

Start Hunting!

Translated by