Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run matlab from C# and give parameter to matlab

Tags:

c#

matlab

I have a C# program which should call Matlab for running a m-file and so Matlab program read parameters from a text file that may be vary on situations.

I want a like this:

Execute(Matlab.exe,"matlabprog.m","input_parameters_file.txt");

It is good for me if i know when this instance of Matlab terminate running.

like image 564
mhn_namak Avatar asked Dec 12 '22 06:12

mhn_namak


1 Answers

Have a look at the Process.Start method:

 var process = Process.Start("matlab.exe", 
                             "matlabprog.m input_parameters_file.txt");
 process.WaitForExit();
like image 126
jeroenh Avatar answered Dec 25 '22 15:12

jeroenh