MATLAB COMPILER RELEASE NOTES Guide de l'utilisateur Page 138

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 264
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 137
5 Controlling Code Generation
5-22
The Compiler processes the string arguments passed to the main() function
and sends them into the compiled M-function as strings.
For example, consider this M-file,
sample.m.
function y = sample( varargin )
varargin{:}
y = 0;
You can compile sample.m into a POSIX main application. If you call sample
from MATLAB, you get
sample hello world
ans =
hello
ans =
world
ans =
0
If you compile sample.m and call it from the DOS shell, you get
C:\> sample hello world
ans =
hello
ans =
world
C:\>
The difference between the M ATLAB and DOS/UNIX environments is the
handling of the return value. In MATLAB, the return value is handled by
printing its value; in the DOS/UNIX shell, the return value is handled as the
return status code. When you compile a function into a POSIX main
application, the first return value from the function is coerced to a scalar and
is returned to the POSIX shell.
Vue de la page 137
1 2 ... 133 134 135 136 137 138 139 140 141 142 143 ... 263 264

Commentaires sur ces manuels

Pas de commentaire