Clear Filters
Clear Filters

Error loading data into popup menu GUI

2 views (last 30 days)
Pedro Galvez
Pedro Galvez on 7 Oct 2017
Commented: Pedro Galvez on 7 Oct 2017
I'm creating a GUI in which I import data from an Excel and I want the name of the columns to appear as options in a pop-up menu. The problem is that it doesn't happen and an error appear. What can I do? I think the error is in the last line but I do not know how to solve it.
Thank you very much!!! Pedro
This is my code:
function datagraphV1
hload=uicontrol('Style', 'pushbutton',...
'String','Load .xlsx','Position',[315,220,70,25],...
function loadbutton_Callback(hObject,eventdata,handles) %Function callback for loading the Excel and changing the
pop-up menu X.
[Comp, Prod, OthInfo, colnames,numcolum]=extractdataexcelV2(handles.filename);

Answers (1)

Niels on 7 Oct 2017
Hi Pedro,
[Comp, Prod, OthInfo, colnames,numcolum]=extractdataexcelV2(handles.filename);
I have never seen this command before. If you want to extract data from an excel file you can use xlsread
[number, text] = xlsread(filename,range); % xlsread('testfile.xlsx','A6:F32');
If text is a vector, your last line should be fine
in my example:
  1 Comment
Pedro Galvez
Pedro Galvez on 7 Oct 2017
Hi Niels, it is a function I have created in order to take directy the information I need.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!