主要内容

在Visual Basic .NET客户端调用MATLAB函数

这个例子调用MATLAB®函数从一个微软®Visual Basic®客户端应用程序通过COM接口。这个例子在一个新的MATLAB窗口中绘制一个图形,并执行一个简单的计算。

Dim MatLab As Object Dim Result As String Dim MReal(1,3) As Double Dim MImag(1,3) As Double MatLab = CreateObject(" MatLab . application ")从VB中调用MATLAB函数Result = MATLAB . execute ("surf(peaks)")'执行简单的计算结果= MatLab。Execute("a = [1 2 3 4;5 6 7 8]")结果= MatLab。Execute("b = a + a ")将矩阵b带入VB程序MatLab中。GetFullMatrix("b", "base", MReal, MImag)

另请参阅

|

相关的话题