.NET2008 调用MATLAB
1。在.net项目中点:add reference,在打开的页面,选择COM|Matlab Application(version 7.0) Type Library等
2。
Subject:
How do I invoke MATLAB as an Automation server from C#?
Problem Description:
How do I invoke MATLAB as an Automation server from C#?
|
Solution: The following simple example illustrates how to invoke MATLAB as an Automation server from C#.
using System; using System.Reflection; namespace ConsoleApplication4 { class Class1 { [STAThread] static void Main(string[] args) Type matlabtype; //Create an instance of MATLAB object matlab; //Prepare input as an object object[] arrayInput = new Object[] {"surf(peaks)"}; //Call MATLAB method matlabtype.InvokeMember("Execute",BindingFlags.InvokeMethod,null,matlab,arrayInput); } } |

您当前的位置: