|MATLAB Function Reference|
Execute a UNIX command and return result
calls upon the UNIX operating system to execute the given command.
status = unix('command')
returns completion status to the
[status, result] = unix('command')
returns the standard output to the
result variable, in addition to completion status.
[status,result] = unix('command',' forces the output to the Command Window, even though it is also being assigned into a variable.
List all users that are currently logged in. It returns a zero (success) in
s and a string containing the list of users in
The next example returns a nonzero value in
s to indicate failure and returns an error message in
why is not a UNIX command.
When including the
-echo flag, MATLAB displays the results of the command in the Command Window as it executes as well as assigning the results to the return variable,
! (exclamation point),