In the last post, I wrote that Perl, called from MATLAB, returned a character array (i.e., ischar(var)=1). I found, on http://www.mathworks.cn/matlabcentral/newsreader/view_thread/17453, the use of the command sscanf.
SSCANF(S,FORMAT,SIZE) reads data from
MATLAB string variable S, converts it according to the specified
FORMAT string, and returns it in matrix A.
Since I need the output to not be a one-dimensional array, I had to use the “reshape” command as well. Look them both up.