563Using MATLAB
®
from within Java
directly invoke MATLAB’s exit command as opposed to eval(‘exit’), since all other proxy
methods block (pause) until completion, but in the case of exiting MATLAB no signal will ever
be sent by MATLAB to indicate that it has closed.
9.4.3 Parsing MATLAB’s Return Values
Our eval commands are being sent using RemoteMatlabProxy’s returningEval(String
command, int returnCount) method, whose return type is Object, because MATLAB can
return multiple return types. For example, the expression “sqrt(5)” will return an array of dou-
bles, “pwd” will return a java.lang.String, and “whos” will return a complicated array of
arrays with a variety of base types and Objects.
This behavior may be different on dif ...