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 CenterFile Exchange에서 Use 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