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

1 次查看(过去 30 天)
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 个评论
Joseph Cheng
Joseph Cheng 2015-5-19
编辑:Joseph Cheng 2015-5-19
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.

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2015-5-19
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.

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by