フィルターのクリア

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

3 ビュー (過去 30 日間)
Inês Mendes
Inês Mendes 2015 年 5 月 19 日
回答済み: Image Analyst 2015 年 5 月 19 日
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 Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by