MATLAB COMPILER RELEASE NOTES Uživatelská příručka Strana 120

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 264
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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.
Zobrazit stránku 119
1 2 ... 115 116 117 118 119 120 121 122 123 124 125 ... 263 264

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

Žádné komentáře