Browse button in GUI in Matlab
Mostra commenti meno recenti
Dear All,
I am newby in Matlab GUI and I am designing a GUI with matlab which gets some directory from "browse pushbutton" , shows the directory in the "answer Edit text box" and after clicking "Load pushbutton", it should sende the value in the text box to main .m file. Also it should wait until the user browse at least something. what I did is in push buttond call back :
[FileName,FilePath]=uigetfile();
ExPath = [FilePath FileName];
set(handles.answer_edit,'String',ExPath);
guidata(hObject, handles);
So I am able to see the directory in "answer edit textbox". But My problem is in Load pushbutton. How I have to pass the results to another .mfile.
Also how I can control that the program should wait until user browse at least something in Edit textbox.
Any help is highly apprecietd.
2 Commenti
Darshil Pragneshbhai Trivedi
il 13 Gen 2022
Hello,
i am a new in this field, and still trying to learn as much as i can, i am working on the type of same thing but in Matlab App Designer, and i have to browse excel file with '.csv' extension, and the file i chose should be written in the editbox, and when i push the load, my GUI should take the data. after then i have to set it as a property so ican connect it with the other callbacks, but how i don't know, if You can help me out with it, it would be a great help from your side.
Image Analyst
il 13 Gen 2022
Risposta accettata
Più risposte (5)
Image Analyst
il 6 Feb 2012
1 voto
You could try a nice framework for doing all that. MAGIC http://www.mathworks.com/matlabcentral/fileexchange/24224
This GUI will help the novice user get up to speed very quickly on using GUI-based applications. Everything is laid out in a very simple Step 1, Step 2, Step 3, etc. layout. It is a very good starting point for a typical image analysis application. This application uses GUIDE to do the user interface design, and has most of the basic controls such as buttons, listboxes, checkboxes, radio buttons, scrollbars, etc. It allows the user to select a folder of images,................
Anyway, you could write the stuff out to a .mat file for your other GUI to read in, or check the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.3F
saharsahar
il 6 Feb 2012
Walter Roberson
il 7 Feb 2012
Start with the Load uicontrol 'Enable' property set 'off', and have your Browse callback set the Load button's Enable to 'on' when it detects valid input. Watch out for the user canceling the uigetfile()
In the Load callback,
get(handles.answer_edit,'String')
and do whatever is appropriate with it.
saharsahar
il 7 Feb 2012
1 Commento
Image Analyst
il 7 Feb 2012
In the load button, try
delete(handles.XXXAlgorithm);
Ka Mirul
il 20 Nov 2017
Modificato: Walter Roberson
il 28 Gen 2018
0 voti
I found a video that help me, it is about creating GUI to browse an image and display the image and its name. It should help you : https://youtu.be/7EmFShs5y9I
Categorie
Scopri di più su Function Creation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!