MATLAB Function Reference |
Execute UNIX command and return result
Syntax
unix command
status = unix('command')
[status,result] = unix('command')
[status,result] = unix('command','-echo
')
Description
unix command
calls upon the UNIX operating system to execute the given command.
status = unix('command')
returns completion status to the status
variable.
[status, result] = unix('command')
returns the standard output to the result
variable, in addition to completion status.
[status,result] = unix('command','
displays the results in the Command Window as it executes, and assigns the results to -echo
')
w
.
Examples
List all users that are currently logged in.
MATLAB returns 0
(success) in s
and a string containing the list of users in w.
MATLAB returns a nonzero value in s
to indicate failure, and returns an error message in w
because why
is not a UNIX command.
See Also
dos
, !
(exclamation point), perl
, system
Running External Programs in the MATLAB Desktop Tools and Development Environment documentation
unique | unmkpp |
© 1994-2005 The MathWorks, Inc.