Store character array in Automation server
PutCharArray([in] BSTR varname, [in] BSTR workspace, [in] BSTR string)
PutCharArray(varname As String, workspace As String, string As String)
PutCharArray(h,'varname','
workspace
','string')
PutCharArray(h,'varname','
stores
the character array in workspace
','string')string
in the specified workspace
of
the server attached to handle h
, assigning to it
the variable varname
. The
values for workspace
are base
or global
. The
function name is case-sensitive.
This example uses the Visual Basic® MsgBox
command
to control flow between MATLAB® and the Visual Basic Client.
Dim Matlab As Object Try Matlab = GetObject(, "matlab.application") Catch e As Exception Matlab = CreateObject("matlab.application") End Try MsgBox("MATLAB window created; now open it...")
Open the MATLAB window, then click Ok.
Matlab.PutCharArray("str", "base", _ "He jests at scars that never felt a wound.") MsgBox("In MATLAB, type" & vbCrLf _ & "str")
In the MATLAB window type str
; MATLAB displays:
str = He jests at scars that never felt a wound.
Click Ok.
MsgBox("closing MATLAB window...")
Click Ok to close and terminate MATLAB.
Matlab.Quit()
Execute
| GetCharArray
| GetWorkspaceData
| PutWorkspaceData