I have developed a matlab project which includes main.m file which calls different functions.Now I want to develop a GUI around the code using GUIDE.How can I input image from GUI and display results calculated by my project in the GUI.
Generic code below could help you with the pushbutton event handler:
function pushbuttonCallback(hObject, eventdata, handles)
[fileName Dir] = uigetfile('*.jpg','select jpg file');
imageDir = strcat(Dir, fileName);
I = imread(imageDir);
** YOUR FUNCTION HERE **
handles.results = YOUR FUNCTION'S RESULTS;
guidata(hObject, handles);
Comments
I'm assuming at this point you already have a pushbutton on your GUI.
Note that code above only save your results in the handler structure. You need to use it to show data on screen depending on the type of result you get from your function.