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 Ansicht (letzte 30 Tage)
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.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 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)

Weitere Antworten (0)

Kategorien

Mehr zu Use COM Objects in MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by