MATLAB COMPILER RELEASE NOTES Guide de l'utilisateur Page 120

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 264
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 119
5 Controlling Code Generation
5-4
foo M-File
function [a, b] = foo(x, y)
if nargout == 0
elseif nargout == 1
a = x;
elseif nargout == 2
a = x;
b = y;
end
fun M-File
function a = fun(b)
a(1) = b(1) .* b(1);
a(2) = b(1) + b(2);
a(3) = b(2) / 4;
sample M-File
function y = sample( varargin )
varargin{:}
y = 0;
Generated Code
This chapter investigates the generated header fil es, interface functions, and
wrapper functions for the C MEX, stand-alone C and C++ t argets, and C and
C++ libraries.
When you use the MATLAB Compiler to compile an M-file, it generates these
files:
C or C++ code, depending on your target language (
-L) specification
Header file
Wrapper file, depending on the
-W option
The C or C++ code that is generated by the Compiler and the header file are
independent of the final target type and target platform. That is, the C or C++
code and header file are identical no matter what the desired final output. The
wrapperfileprovidesthe code necessaryt o support theoutputexecutabletype.
So, the wrapper file is different for each execut able type.
Vue de la page 119
1 2 ... 115 116 117 118 119 120 121 122 123 124 125 ... 263 264

Commentaires sur ces manuels

Pas de commentaire