exponenta event banner

Вызов функции MATLAB из клиента Visual Basic .NET

Этот пример вызывает функции MATLAB ® из клиентского приложения Microsoft ® 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")

'Call MATLAB function from VB
Result = MatLab.Execute("surf(peaks)")

'Execute simple computation
Result = MatLab.Execute("a = [1 2 3 4; 5 6 7 8]")
Result = MatLab.Execute("b = a + a ")

'Bring matrix b into VB program
MatLab.GetFullMatrix("b", "base", MReal, MImag)

См. также

|

Связанные темы