MATLAB COMPILER RELEASE NOTES User's Guide Page 157

  • Download
  • Add to my manuals
  • Print
  • Page
    / 264
  • Table of contents
  • TROUBLESHOOTING
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 156
Interfacing M-Code to C/C++ Code
5-41
private, or method). When using this pragma, the Compiler will generate an
additional header file called
file_external.h or file_external.hpp, where
file is the name of the initial M-file containing the %#external pragma. This
header file will contain the
extern declaration of the function that the user
must provide. This function must conform to the same interface as the
Compiler-generated code.
The Compiler will still generate a
.c or .cpp file from the .m file in question.
The Compiler will generate the
feval table, which includes the function and
all of the required interface functions for the M-function, but the body of
M-code from that function will be ignored. It will be replaced by the
hand-written code. The Compiler will generate the interface for any functions
that contain the
%#external pragma into a separate file called
file_external.h or file_external.hpp. The Compiler-generated C or C++
file will include this header file to get the declaration of the function being
provided.
In this example, place the pragma in the
collect_one local function.
function collect
y = zeros(1, 100); % pre-allocate the matrix
for i = 1:100
y(i) = collect_one;
end
function y = collect_one
%#external
persistent t;
if (isempty(t))
t = 0;
end
t = t + 0.05;
end
y = sin(t);
When this file is compiled, the Compiler creates the additional header file
collect_external.h, w hich contains the interface betwee n the
Compiler-generated code and your code. In this e xample, it would contain
extern mxArray *Mcollect_collect_one( int nargout_ );
Page view 156
1 2 ... 152 153 154 155 156 157 158 159 160 161 162 ... 263 264

Comments to this Manuals

No comments

Energizer CAPW2BODE manuali

Manuali dei proprietari e guide per l'utente per Torce Energizer CAPW2BODE.
We fornisce 1 manuali pdf Energizer CAPW2BODE per scaricare gratuitamente in base al tipo di documento: Scheda Tecnica


Energizer CAPW2BODE Scheda Tecnica (1 pagine)


Marchio: Energizer | Categoria: Flashlights | Dimensione: 0.07 MB |

 




Più prodotti e manuali per Torce Energizer

Modelli Tipo di Documento
SOLRE35BP Scheda Tecnica   Energizer Solar Folding Lantern, 1 pagine
HD33A2ODE Scheda Tecnica   Energizer HD33A2ODE flashlight, 1 pagine
SOLCKCCBP Scheda Tecnica   Energizer Solar Carabiner Crank Light, 1 pagine
CAPR22ODE Scheda Tecnica   Energizer CAPR22ODE flashlight, 1 pagine
ECAP1AAE Scheda Tecnica   Energizer ECAP1AAE flashlight, 1 pagine
CAPG2BODE Scheda Tecnica   Energizer CAPG2BODE flashlight, 1 pagine
631637 Scheda Tecnica   Energizer Pro-Headlight 4 LED, 1 pagine
MILMOS11L Scheda Tecnica   Energizer MILMOS11L flashlight, 1 pagine
FL452WRH Scheda Tecnica   Energizer FL452WRH flashlight, 1 pagine
PLED34AE Scheda Tecnica    Energizer PLED34AE flashlight, 1 pagine
ELMCL11L Scheda Tecnica   Energizer ELMCL11L flashlight, 1 pagine
HD3LMS32E Scheda Tecnica   Energizer 3 LED Micro Sport Headlight, 1 pagine
3151LS Scheda Tecnica   Energizer 3151LS flashlight, 1 pagine
RCL1NM2WR Scheda Tecnica   Energizer RCL1NM2WR flashlight, 1 pagine
KCC2BODBP Scheda Tecnica   Energizer KCC2BODBP flashlight, 1 pagine
WRCLD41E Scheda Tecnica   Energizer WRCLD41E flashlight, 1 pagine
631638 Scheda Tecnica   Energizer Pro-Headlight 7 LED, 1 pagine
625702 Scheda Tecnica   Energizer Hi-Tech LED 2 in 1, 1 pagine
625701 Scheda Tecnica   Energizer Penlight, 1 pagine
632026 Scheda Tecnica   Energizer ENATEX, 1 pagine