I am building a Windows Forms Application that uses a MATLAB back end. What is the best, possibly cleanest, way to do this? Furthermore, I need to grab the MATLAB output data and work with it in the Windows Forms program.
What I have done so far:
Using the Process class I ran a batch file that calls the MATLAB program:
Process process = new Process(); process.StartInfo.FileName = @"----\run.bat"; process.StartInfo.WorkingDirectory = @"----"; process.StartInfo.UseShellExecute = false; process.StartInfo.RedirectStandardOutput = true; process.StartInfo.RedirectStandardError = true;
I am able to run the script without a problem. However, I cannot receive the output stream from MATLAB. I tried all of the solutions in the link above, but it does not work in my particular situation. I assume this has something to do with MATLAB.