using System; using System.Reflection;namespace ConsoleApplication4 { class Class1 { [STAThread] static void Main(string[] args) { //Get the type info Type matlabtype; matlabtype = Type.GetTypeFromProgID("matlab.application"); //Create an instance of MATLAB object matlab; matlab = Activator.CreateInstance(matlabtype); //Prepare input as an object object[] arrayInput = new Object[] {"surf(peaks)"}; //Call MATLAB method matlabtype.InvokeMember("Execute",BindingFlags.InvokeMethod,null,matlab,arrayInput); } } }
using System.Reflection;namespace ConsoleApplication4
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
//Get the type info Type matlabtype;
matlabtype = Type.GetTypeFromProgID("matlab.application"); //Create an instance of MATLAB object matlab;
matlab = Activator.CreateInstance(matlabtype); //Prepare input as an object object[] arrayInput = new Object[] {"surf(peaks)"}; //Call MATLAB method matlabtype.InvokeMember("Execute",BindingFlags.InvokeMethod,null,matlab,arrayInput);
}
}
}