How to extract a excel file to a GUI after the user chooses it on a popup menu?
조회 수: 3 (최근 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
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
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!