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

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 274
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 184
Optimizing Conditionals
6-9
Optimizing Conditionals
(optimize_conditionals) This optimization reduces the MATLAB conditional
operators to scalar C conditional operators when both operands are known to
be integer scalars. The Compiler knows that
nargin, nargout, and for-loop
control variables (when using the above optimization) are integer scalars. For
example:
function test(a,b,c,d)
if (nargin < 4)
d = 0.0;
end
If you compile this with the -O none option, you get
...
if (mlfTobool(mclLt(mlfScalar(nargin_), mlfScalar(4)))) {
...
Compiling with -O none -O optimize_conditionals:on gives
...
if (nargin_ < 4) {
...
Zobrazit stránku 184
1 2 ... 180 181 182 183 184 185 186 187 188 189 190 ... 273 274

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

Žádné komentáře