system
Execute operating system command and return output
Syntax
Description
calls
the operating system to execute the specified command. The operation
waits for the command to finish execution before returning the exit
status of the command to the status
= system(command
)status
variable.
The function starts a new cmd/shell process, executes
command
, exits the process, and returns to the
MATLAB® process. Updates to the system environment made by
command
are not visible to MATLAB.
[
sets the values of operating system environment variables. If
status
,cmdout
]
= system(___,EnvName
1,EnvVal
1,...,EnvName
N,EnvVal
N)EnvName
exists as an environment variable, then
system
replaces its current value with
EnvVal
. If EnvName
does not
exist, then system
creates an environment variable called
EnvName
and assigns EnvVal
to
it.
system
passes EnvName
and
EnvVal
to the operating system unchanged. Special
characters, such as ;
, /
,
:
, $
, and %
, are
unexpanded in EnvVal
.
Examples
Input Arguments
Output Arguments
Limitations
MATLAB converts characters to the encoding that your operating system shell accepts. Output from the
command
is converted to the MATLAB encoding to be displayed in the command window. If you get unexpected results from the command, enter thecommand
argument directly at the operating system prompt to see how the operating system treats your input.Callback functions are not called while the
system
command is executing.