MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Uživatelská příručka Strana 232

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 354
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 231
1 2 ... 227 228 229 230 231 232 233 234 235 236 237 ... 353 354

Komentáře k této Příručce

Žádné komentáře