How to link m-files iwith a push button in GUI maltab

1 view (last 30 days)
I had a GUI interface, i wish to run my function which save in m-file with one of a push button in my GUI. Please show me the ways to handle this situation..thanks alot

Accepted Answer

Walter Roberson
Walter Roberson on 17 Mar 2013
In the callback of your push button, just give the name of the function you wish to run. For example,
function pushbutton1_callback( hObject, event )
your_function_name_here();
end
  2 Comments
chin
chin on 17 Mar 2013
thanks you so much..it's totally works! btw, i have a problem, how can i show the images that i developed in my m-files on the axes in GUI... i tried this axes(handles.axes1),imshow(img);
img is my images that processed in m-file. thanks..
Walter Roberson
Walter Roberson on 17 Mar 2013
That is fine, or you could use
imshow(img, 'Parent', handles.axes1)

Sign in to comment.

More Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!