MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE Guida Utente Pagina 149

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
Vedere la pagina 148
Supported Executable Types
5-23
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 MATLAB 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.
Vedere la pagina 148
1 2 ... 144 145 146 147 148 149 150 151 152 153 154 ... 273 274

Commenti su questo manuale

Nessun commento