Run matlab from C # and give the matlab parameter

I have a C # program that needs to call Matlab to run an m file, and so the Matlab program reads the parameters from a text file, which can change in situations.

I need the following:

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

This is good for me if I know when this instance of Matlab exits.

+4
source share
2 answers

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

+5
source

Take a look at the Process.Start method:

  var process = Process.Start("matlab.exe", "matlabprog.m input_parameters_file.txt"); process.WaitForExit(); 
+8
source

Source: https://habr.com/ru/post/1390921/


All Articles