Run matlab from C# and give parameter to matlab

2020-07-18 09:51发布

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.

标签: c# matlab
2条回答
【Aperson】
2楼-- · 2020-07-18 10:06

Consider using the Matlab engine or compile a .NET Assembly using the Matlab Builder NA. Also check out this post, in which I explain some of the possibilities.

查看更多
够拽才男人
3楼-- · 2020-07-18 10:21

Have a look at the Process.Start method:

 var process = Process.Start("matlab.exe", 
                             "matlabprog.m input_parameters_file.txt");
 process.WaitForExit();
查看更多
登录 后发表回答