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

  • 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 187
mbcharscalar
7-10
7mbcharscalar
Purpose Assert variable is a character scalar.
Syntax mbcharscalar(x)
Description The statement
mbcharscalar(x)
causes the MATLAB Compiler to impute that x is a character scalar, i.e., an
unsigned short variable. At runtime, if
mbcharscalar determines that x holds
a value other than a character scalar,
mbcharscalar issues an error message
and halts execution of the MEX-file.
mbcharscalar t ells the MATLAB interpreter to check whether x holds a
character scalar value. If
x does not, mbcharscalar issues an error message
and ha lts execution of the M-file. The MATLAB interpreter does not use
mbcharscalar to impute x.
Note that
mbcharscalar only tests x at the point in an M-file orMEX-file where
an
mbcharscalar call appears. In other words, an mbcharscalar call tests the
value of
x only once. If x becomes a vector after the mbcharscalar test,
mbcharscalar cannot issue an error message.
mbcharscalar defines a character scalar as any value that meets the criteria of
both
mbchar and mbscalar.
Example This code in MATLAB generates an error message.
n = ['hello' 'world'];
mbcharscalar(n)
??? Error using ==> mbscalar
Argument of mbscalar must be scalar.
See Also mbchar, mbcharvector, mbreal, mbscalar, mbvector, mbintscalar,
mbintvector, mcc
Zobrazit stránku 187
1 2 ... 183 184 185 186 187 188 189 190 191 192 193 ... 263 264

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

Žádné komentáře