Gui cannot find the listbox1 when I run the fig file
Afficher commentaires plus anciens
Dear all,
Silently, I have followed this help center for 2 years. I thank you all for you to teach me matlab from scratch. Recently, I started to work on gui matlab and I learned a lot as a beginner to gui. I couldn't figure out a problem and couldn't find an answer here.
I created a gui code. When I run it from gui editor by using the run figure (Ctrl + T) it works, but when I open the fig file by double clicking it doesn't work. The reason is the listbox cannot be recognized (Attempt to reference field of non-structure array). Here is the code for Find .xls Files button and a picture of gui design. Basically, I search the folder for certain xls files and sort them in order than load them into the matlab and make some calculations and plot normalized values and regular values. Again, The gui works when I open it from the gui editor but doesn't want to run when I click the button. I hope I was clear on describing my problem.
Thank you all,
files = dir(fullfile(pwd,'*_03_graphfiles.xls'));
set(handles.listbox1,'Max',2,'Min',0,'string',{files.name});
files = dir(fullfile(pwd,'*_04_graphfiles.xls'));
set(handles.listbox3,'Max',2,'Min',0,'string',{files.name});
files = dir(fullfile(pwd,'*_05_graphfiles.xls'));
set(handles.listbox4,'Max',2,'Min',0,'string',{files.name});
set(handles.listbox1, 'Value', []);
set(handles.listbox3, 'Value', []);
set(handles.listbox4, 'Value', []);
set(handles.listbox5, 'Value', []);

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Interactive Control and Callbacks dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!