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 view (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Jan 2010
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)

More Answers (0)

Community Treasure Hunt

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

Start Hunting!