External Interfaces Reference |
Store data in server workspace
MATLAB Client
h.PutWorkspaceData('varname', 'workspace
', data) PutWorkspaceData(h, 'varname', 'workspace
', data) invoke(h, 'PutWorkspaceData
', 'varname', 'workspace
', data)
Method Signature
Visual Basic Client
Description
PutWorkspaceData
stores data
in the specified workspace
of the server attached to handle h
, assigning to it the variable varname
. The workspace
argument can be either base
or global
.
Note
PutWorkspaceData works on all MATLAB data types except sparse arrays, structure arrays, and function handles. Use the Execute method for these data types.
|
Remarks
You can use PutWorkspaceData
in place of PutFullMatrix
and PutCharArray
to pass numeric and character array data respectively to the server.
Server function names, like PutWorkspaceData
, are case sensitive when using the first syntax shown.
There is no difference in the operation of the three syntaxes shown above for the MATLAB client.
The GetWorkspaceData
and PutWorkspaceData
functions pass numeric data as a variant
data type. These functions are especially useful for VBScript clients as VBScript does not support the safearray
data type used by GetFullMatrix
and PutFullMatrix
.
Examples
Create an array in the client and assign it to variable A
in the base workspace of the server:
MATLAB Client
h = actxserver('matlab.application'); for i = 0:6 data(i+1) = i * 15; end h.PutWorkspaceData('A', 'base', data)
Visual Basic Client
Dim Matlab As Object Dim data(6) As Double MatLab = CreateObject("matlab.application") For i = 0 To 6 data(i) = i * 15 Next i MatLab.PutWorkspaceData("A", "base", data)
See Also
GetWorkspaceData
, PutFullMatrix
, GetFullMatrix
, PutCharArray
, GetCharArray
, Execute
See Executing Commands in the MATLAB Server for more examples.
PutFullMatrix | Quit |
© 1994-2005 The MathWorks, Inc.