Why do NaNs in a cell array not pass correctly when connecting two MATLAB 7.4 (R2007a) sessions via COM automation?

1 次查看(过去 30 天)
In a client session of MATLAB, open up a server:
h = actxserver('matlab.application')
In the server session of MATLAB, create a cell array with a "NaN":
A = { 1 2 NaN }
From the client session of MATLAB, retrieve the cell array with the "GetWorkspaceData" method:
A = h.GetWorkspaceData('A','base')
A{3}
In place of the "NaN" as the third element of the cell array is an error message:
ActiveX VT_ERROR: Parameter not found.

采纳的回答

MathWorks Support Team
MATLAB conforms to IEEE specifications for NaN, but this is an exceptional case in which VB does not conform to IEEE 754, but rather issues an error instead.
To work around the issue, either pre-process the NaN's to conform with a COM data type, or post-process the error messages in the client back into MATLAB NaNs.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Use COM Objects in MATLAB 的更多信息

产品


版本

R2007a

Community Treasure Hunt

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

Start Hunting!

Translated by