Matlab - Compiler User's Guide 1.2

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Publisher: The MathWorks
Year: 1998

Language: English
Pages: 276

Introducing the MATLAB Compiler......Page 13
Before You Begin......Page 14
Creating MEX-Files......Page 15
C++ Stand-Alone External Applications......Page 16
Creating a Stand-Alone Application......Page 17
The MATLAB Compiler Family......Page 19
Why Compile M-Files?......Page 20
Installation and Configuration......Page 23
Unsupported MATLAB Platforms......Page 24
Overview......Page 25
Stand-Alone C++ Applications......Page 27
ANSI Compiler......Page 28
MEX Configuration......Page 29
Using setup......Page 30
MEX Verification......Page 32
MATLAB Compiler Verification......Page 33
MATLAB Compiler......Page 35
Things to Be Aware of......Page 36
Using setup......Page 37
MEX Verification......Page 39
MATLAB Compiler Verification......Page 40
68K Macintosh......Page 41
ANSI Compiler......Page 42
Using setup......Page 43
Changing Compilers......Page 44
MEX Verification......Page 45
Testing the MATLAB Compiler......Page 46
Updating Project......Page 47
Access Path Message......Page 48
Special Considerations for MPW......Page 49
MEX Troubleshooting......Page 50
Stack Overflow on Macintosh......Page 51
MATLAB Compiler Cannot Generate MEX-File......Page 52
Getting Started......Page 53
Invoking the M-File......Page 55
Invoking the MEX-File......Page 56
Optimizing......Page 57
Using the -S Option......Page 58
Using -e Option......Page 59
Data Type......Page 60
MATLAB Code......Page 61
Differences Between the MATLAB Compiler and Interp.........Page 62
Restrictions on Stand-Alone External Applications......Page 63
Converting Script M-Files to Function M-Files......Page 64
Optimizing Performance......Page 67
Type Imputation Across M-Files......Page 69
Optimizing with Compiler Option Flags......Page 71
Type Imputations for Unoptimized Case......Page 72
The Generated Loop Code......Page 73
Type Imputations for -r......Page 74
The Generated Loop Code for -r......Page 75
Optimizing with the -i Option......Page 76
Type Imputations for -ri......Page 77
The Generated Loop Code for -ri......Page 78
Optimizing Through Assertions......Page 79
An Assertion Example......Page 81
Optimizing with Pragmas......Page 83
Effects of the Real-Only Functions......Page 84
Automatic Generation of the Real-Only Functions......Page 85
Identifying Callbacks......Page 86
Compiling Multiple M-Files into One MEX-File......Page 87
Compiling MATLAB Provided M-Files......Page 89
Compiling M-Files That Call feval......Page 91
Optimizing by Preallocating Matrices......Page 93
Optimizing by Vectorizing......Page 95
Stand-Alone External Applications......Page 97
Introduction......Page 98
Overview......Page 100
Packaging Stand-Alone Applications......Page 101
Introducing mbuild......Page 102
Configuring mbuild......Page 103
Changing Compilers......Page 104
Locating Shared Libraries......Page 105
Verifying the MATLAB Compiler......Page 106
The mbuild Script......Page 107
Distributing Stand-Alone UNIX Applications......Page 109
Configuring mbuild......Page 110
Verifying mbuild......Page 112
The mbuild Script......Page 113
Customizing mbuild......Page 115
Distributing Stand-Alone Windows Applications......Page 116
Configuring mbuild......Page 117
Verifying mbuild......Page 118
The mbuild Script......Page 119
Distributing Stand-Alone Macintosh Applications......Page 121
Directory or File Not Writable......Page 122
Verification of mbuild Fails......Page 123
MATLAB Compiler Does Not Generate Application......Page 124
Reducing Memory Usage......Page 125
Coding with M-Files Only......Page 127
Compiling MATLAB-Provided M-Files Separately......Page 131
Compiling mrank.m and rank.m as Helper Functions......Page 132
Source Code Is Not Entirely Function M-Files......Page 133
Source Code Is Entirely Function M-Files......Page 135
Stand-Alone C Mode......Page 138
Stand-Alone C++ Mode......Page 139
Simple Example......Page 140
An Explanation of mrankp.c......Page 144
Advanced C Example......Page 145
An Explanation of This C Code......Page 147
Advanced C++ Example......Page 148
Notes......Page 153
The Generated Code......Page 155
Porting Generated Code to a Different Platform......Page 156
MEX-File Source Code Generated by mcc......Page 157
MEX-File Gateway Function......Page 158
Complex Argument Check......Page 159
Computation Section — Complex Branch and Real Bran.........Page 160
Declaring Variables......Page 161
Importing Input Arguments......Page 162
Performing Calculations......Page 163
Export Output Arguments......Page 164
Stand-Alone C Source Code Generated by mcc -e......Page 165
Name of Generated Function......Page 166
Input Arguments......Page 167
The Body of the mlf Routine......Page 168
Trigonometric Functions......Page 169
Header Files......Page 171
Output Arguments......Page 172
Input Arguments......Page 173
Functions with Optional Arguments......Page 174
Function Body......Page 175
Directory Organization......Page 177
Directory Organization on UNIX......Page 179
/extern/lib/$ARCH......Page 180
/extern/include......Page 181
/extern/src/math/tbxsrc......Page 182
/extern/examples/compiler......Page 183
/toolbox/compiler......Page 186
Directory Organization on Microsoft Windows......Page 188
\bin......Page 189
\extern\lib......Page 190
\extern\include......Page 191
\extern\include\cpp......Page 192
\extern\examples\compiler......Page 193
\toolbox\compiler......Page 196
Directory Organization on Macintosh......Page 198
:extern:src:math:tbxsrc:......Page 199
:extern:lib:PowerMac:......Page 200
:extern:lib:68k:Metrowerks:......Page 201
:extern:include:......Page 202
:extern:examples:compiler:......Page 203
:toolbox:compiler:......Page 205
Reference......Page 207
Introduction......Page 208
MATLAB Compiler Options for C++......Page 210
%#function......Page 211
%#inbounds......Page 212
%#ivdep......Page 214
%#realonly......Page 217
mbchar......Page 219
mbcharscalar......Page 220
mbcharvector......Page 221
mbint......Page 222
mbintscalar......Page 224
mbintvector......Page 225
mbreal......Page 226
mbrealscalar......Page 227
mbrealvector......Page 228
mbscalar......Page 229
mbvector......Page 230
mbuild......Page 231
mcc......Page 234
-c (C Code Only)......Page 235
-g (Debugging Information)......Page 236
-h (Helper Functions)......Page 237
-l (Line Numbers)......Page 238
-m (main Routine)......Page 239
-r (Real)......Page 240
-s (Static)......Page 241
-w (Warning) and -ww (Complete Warnings)......Page 242
-z (Specifying Library Paths)......Page 243
-u (Number of Inputs) and -y (Number of Outputs)......Page 244
reallog......Page 245
realpow......Page 246
realsqrt......Page 247
MATLAB Compiler Library......Page 249
MATLAB Compiler Library......Page 250