Main Menu

Menu

Sunday 22 May 2011

Call Matlab from Visual C# 2010

First of all you have to include:
using System.Diagnostics;

and then add a button:







Double clicking the new button Matlab, the automated code in red will be produced and it is time to add the following code (in blue):

        private void button16_Click(object sender, EventArgs e)
        {

            Process myProcess = new Process();
            //Here you use your own application with full path
            myProcess.StartInfo.FileName = @"C:\Program Files\MATLAB\R2010a\bin\matlab.exe";
            myProcess.StartInfo.CreateNoWindow = true;
            myProcess.Start();
        }

and that is all folks.

No comments:

Post a Comment