Is there a way to return a perl array to MATLAB? Or do I just have to return a string and parse it? I’m using a call from MATLAB to a perl script to interface with a MySQL database. After I get the results of a query, I want to pass it back to MATLAB.
EDIT: I’m using a modified version of perl.m to call the perl script. It calls the version of perl with DBI I installed, rather than the copy that comes with MATLAB.
I changed line 65 of perl.m from
perlCmd = fullfile(matlabroot, 'sys\perl\win32\bin\');
to
perlCmd = 'C:\Perl64\';
how are you calling your perl script? if you are just doing a system call, then you can only return string output.
you could look into wrapping your call in a mex file, or writing .mat files from your perl, but i suspect string parsing may be easier, especially for small arrays
EDIT
think what i did once in a similar situation (had to transfer data into matlab) was to generate an .m file that creates a matlab matrix, i.e.
and save to disk. when the program was finished i simply called the m-file to get the data into my workspace