How do I import a character array from MATLAB into VB using ActiveX?

How do I import a character array from MATLAB into VB using ActiveX?

 采纳的回答

This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
You can use the GetCharArray interface to import a character array from MATLAB (as an automation server) workspace into your VB application. The following code shows a small example:
Function test()
Dim MatLab As Object
Dim Result As String
Set MatLab = CreateObject("Matlab.Application")
MatLab.Execute ("a='abcdefghijklmnopqrstuvwxyz'")
Result = MatLab.GetCharArray("a", "base")
End Function
You can use the PutCharArray interface to send a character array from the client to the MATLAB automation server.

更多回答(0 个)

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by