Is it possible to call MATLAB files from a Visual Basic application using ActiveX?
4 次查看(过去 30 天)
显示 更早的评论
I would like to know if it is possible to call MATLAB files from a Visual Basic application using ActiveX.
采纳的回答
MathWorks Support Team
2010-1-28
It is possible to call MATLAB files from a Visual Basic application using ActiveX features.
Here is an example:
Dim MatLab As Object
Private Sub Command1_Click()
Dim Result As String
Dim MReal(1, 3) As Double
Dim MImag() As Double
Set MatLab = CreateObject("Matlab.Application")
'CALLING MATLAB FILE FROM VB
Result = MatLab.Execute("cd D:\MATLABR12\work\alltest")
Result = MatLab.Execute("myfile")
'OTHER THINGS THAT CAN BE DONE
Result = MatLab.Execute("surf(peaks)")
Result = MatLab.Execute("a = [1 2 3 4; 5 6 7 8;]")
Result = MatLab.Execute("b = a + a ")
Call MatLab.GetFullMatrix("b", "base", MReal, MImag)
End Sub
For more information, refer to Chapter 7 of the MATLAB External Interface/API User's Guide.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ActiveX 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!