Getting Pop-up menu output as Excel sheet for plotting
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Varun Kumar
am 16 Mai 2019
Kommentiert: Walter Roberson
am 21 Mai 2019
hi everyone,
i am creating a gui which will help to compare the data from two selected sheets of excel file via plotting, excel file consist of various sheets. i am using one pusbutton for importing the excel file and two popup menu button for selection of two desired sheets of excel file and finally one axes to plot the data. my problem is that when i select a particular sheet from popup menu its not getting selected as file.

3 Kommentare
Akzeptierte Antwort
Geoff Hayes
am 19 Mai 2019
Varun - I don't understand this line of code
data111=xlsread(handles.popupmenuX,' data11')
Why are you using the handle of the popupmenu (X) as the file name? In your initial code post, you are using a filename field from the handles structure. Why the change? Also, why are you putting data11 in quotes? (Again this differs from your initial code post...)
6 Kommentare
Walter Roberson
am 21 Mai 2019
I suspect that your
a=data1(:,19);
is not in the same function that
plot(handles.axes1, a,b,'r',a,c,'g',a,d,'b','MarkerSize',10)
is in.
Also, your code
[~, Sheets2]=xlsfinfo(handles.filename)
set(hObject,'String',Sheets2)
index_selected = get(hObject, 'Value')
sheet_list=get(hObject, 'String')
selectedsheet=sheet_list{index_selected}
gets the names of the sheets from xlsinfo, sends it to the the popup string list, and then immediately without giving any time to draw the control or for the user to choose something, asks which value the user chose.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
