Why does the ISEQUAL function behave differently in MATLAB from in a deployed COM object created with the MATLAB COM Builder 1.0 (R13) when used with global variable arguments?

1 回表示 (過去 30 日間)
I have developed MATLAB code in that uses the ISEQUAL function on a global variable to test if the global variable is empty, similar to the following:
function result = test()
global myGlobal;
result = isequal(myGlobal, [])
When I run this code in MATLAB, I see that "result" equals 1, as I would expect.
I then deploy this function as a COM object using the MATLAB COM Builder 1.0 (R13). When I call my COM object from another application, I then see that "result" is equal to 0. This is inconsistent with the behavior of my code running in the MATLAB environment.

採用された回答

MathWorks Support Team
MathWorks Support Team 2010 年 1 月 22 日
This bug was corrected as of the MATLAB Builder for COM 1.1 (R14).
There is a bug in the MATLAB COM Builder 1.0 (R13) in the way that the ISEQUAL function with global variable arguments behaves differently in a deployed COM object than it does when used within MATLAB.
To work around this issue using older releases of the MATLAB COM Builder, use the ISEMPTY function to test if global variables are empty, as opposed to the ISEQUAL function.
For example, instead of using this syntax:
res = isequal(myGlobal, [])
use the following syntax:
res = isempty(myGlobal)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeUse COM Objects in MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by