College of Natural Sciences
 
FAQs
This is for IE7 to hold div open

2.5.2. How do CallBacks work? What is the best way to write a CallBack?

A CallBack is the specified action that MATLAB performs when the user selects the menu item to which the CallBack has been assigned. When the button or menu item is selected, the expression contained within the CallBack string is executed. For example:

h=uicontrol('Style','PushButton','String','title',...

'CallBack','disp(''hello'')')'

When you push on the button, hello will be displayed in the MATLAB workspace. The most efficient way to write a CallBack is to make the CallBack a function. That way, the function is stored in RAM and will execute more quickly if you are going to be using the button often.