MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Guide de l'utilisateur Page 232

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 354
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 231
12 Limitations and Restriction s
Workaround
There are several ways to eliminate this error.
Using the
%#function pragma and specifying callbacks as strings
Specifying callbacks with function handles
Using the
-a option
Specifying Callbacks as Strings. Create a list of all the functions that are
specified only in callback strings and pass these functions using separate
%#function pragma statements. T his overrides MATLAB Compile r’s
dependency analysis and instructs it to explicitly include the functions listed
in the
%#function pragmas.
For example, the call to the
change_colormap function in the sample
application,
my_test, illustrates this problem. To make sure MATLAB
Compiler processes the
change_colormap M-file, list the fu nction name in the
%#function pragma.
function my_test()
% Graphics library callback test application
%#function change_colo rmap
peaks;
p_btn = uicontrol(gcf,...
'Style', 'pushbutton' ,...
'Position',[10 10 133 25 ],...
'String', 'Make Black & White',...
'CallBack','change_colormap');
Specifying Callba ck s with F unction Handles. To specify the callbacks
with function handles, use the same code as in the example above and replace
thelastlinewith
'CallBack',@change_colormap);
12-4
Vue de la page 231
1 2 ... 227 228 229 230 231 232 233 234 235 236 237 ... 353 354

Commentaires sur ces manuels

Pas de commentaire