unix('command')[status,output] = unix('command')
unix('command') executes a UNIX operating system command. The statement returns the resulting status as an integer and the standard output in a string variable.
[s,w] = unix('who') returns s = 0 and, in w, a MATLAB string containing a list of users currently logged in.
If the UNIX command fails, MATLAB returns a nonzero status value. For example,s =0w =gulley console Apr 13 09:32joe ttyp0 Apr 13 09:02sully ttyp2 Apr 13 09:37gulley ttyp2 Apr 13 09:37gulley ttyp3 Apr 13 09:34marianne ttyp4 Apr 13 10:43
[s,w] = unix('why')why: Command not found.s =256w =[]
!
(c) Copyright 1994 by The MathWorks, Inc.