External Interfaces Reference |
Get data from server workspace
MATLAB Client
D = h.GetWorkspaceData('varname', 'workspace
') D = GetWorkspaceData(h, 'varname', 'workspace
') D = invoke(h, 'GetWorkspaceData
', 'varname', 'workspace
')
Method Signature
Visual Basic Client
Description
GetWorkspaceData
gets the data stored in the variable varname
from the specified workspace
of the server attached to handle h
and returns it in output argument D
. The workspace
argument can be either base
or global
.
Note
GetWorkspaceData works on all MATLAB data types except sparse arrays, structures, and function handles.
|
Remarks
You can use GetWorkspaceData
in place of GetFullMatrix
and GetCharArray
to get numeric and character array data respectively.
If you want output from GetWorkspaceData
to be displayed at the client window, you must specify an output variable.
Server function names, like GetWorkspaceData
, 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
Assign a cell array to variable C1
in the base workspace of the server, and then read it back with GetWorkspaceData
.
MATLAB Client
h = actxserver('matlab.application'); h.PutWorkspaceData('C1', 'base', {25.72, 'hello', rand(4)}); C2 = h.GetWorkspaceData('C1', 'base') C2 = [25.7200] 'hello' [4x4 double]
Visual Basic Client
Dim Matlab, C2 As Object Dim Result As String Matlab = CreateObject("matlab.application") Result = MatLab.Execute("C1 = {25.72, 'hello', rand(4)};") Matlab.GetWorkspaceData("C1", "base", C2)
See Also
PutWorkspaceData
, GetFullMatrix
, PutFullMatrix
, GetCharArray
, PutCharArray
, GetVariable
, Execute
GetVariable | MaximizeCommandWindow |
© 1994-2005 The MathWorks, Inc.