MATLAB Compiler    

Fixing Callback Problems: Missing Functions

When the Compiler creates a stand-alone application, it compiles the M-file you specify on the command line and, in addition, it compiles any other M-files that your M-file calls. If your application includes a call to a function in a callback string or in a string passed as an argument to the feval function or an ODE solver, and this is the only place in your M-file this function is called, the Compiler will not compile the function. The Compiler does not look in these text strings for the names of functions to compile.

Symptom

Your application runs, but an interactive user interface element, such as a push button, is unresponsive. When you close the application, the graphics library issues this error message.

Workaround

To eliminate this error, create a list of all the functions that are specified only in callback strings and pass this list to the %#function pragma. (See Finding Missing Functions in an M-File for hints about finding functions in callback strings.) The Compiler processes any function listed in a %#function pragma.

For example, the call to the change_colormap function in the sample application, my_test, illustrates this problem. To make sure the Compiler processes the change_colormap M-file, list the function name in the %#function pragma:

Finding Missing Functions in an M-File

To find functions in your application that may need to be listed in a %#function pragma, search your M-file source code for text strings specified as callback strings or as arguments to the feval, fminbnd, fminsearch, funm, and fzero functions or any ODE solvers.

To find text strings used as callback strings, search for the characters "Callback" or "fcn" in your M-file. This will find all the Callback properties defined by Handle Graphics® objects, such as uicontrol and uimenu. In addition, this will find the properties of figures and axes that end in Fcn, such as CloseRequestFcn, that also support callbacks.


  Stand-Alone Applications Installation and Configuration