PROBLEM
I have two tools written in MATLAB (I am not the author):
- the first allows me to retrieve some data from a SQL database, but it works only on MATLAB 64bit (I have MATLAB 2016b 64bit).
- the second uses the data retrieved from the first tool and, through a DLL compiled on a 32bit system, it gets some outputs. As said, this tool works only MATLAB 32bit (I have MATLAB 2013a 32bit).
What I would like to do is:
- get the data from SQL, in MATLAB 64bit
- "send them" in some way to MATLAB 32bit
- run the tool on MATLAB 32bit
- "return" the outputs from MATLAB 32bit to MATLAB 64bit
I know a solution may be found using IPC mechanisms, but I am not sure how to find them or how to use them in MATLAB. Does anyone ever worked with this kind of stuff?
Looking into the MATLAB documentation I saw that it is possible to create a COM object, but I am not sure how to use it to run some functions in MATLAB 32bit.
SOLUTION
As suggested by @nekomatic below, everything works for me if I run the code in the way suggested, but excluding -automatic from the system command below. The final system command is in the form
system('"C:\path\to\R2013a\matlab.exe" -wait -r "mycommand; exit"') mycommand is a MATLAB script which loads the input file, it does something and then it saves an output file.