MATLAB: Does a MATLAB Class not update Properties unless debugging it

classcodedebugeditorexecutinggetincorrectlinesMATLABmethodnotpropertysetskippingupdatingvaluevariable

I have a MATLAB class which is supposed to update properties automatically, but this does not occur unless I debug the program.
When I inspect the class in the variable editor while debugging, the property values are correct and the code produces the expected results.
Why is MATLAB skipping the update when I am not debugging?

Best Answer

When a class is opened in the MATLAB Variable Editor, each of its properties' associated get methods are executed. By inspecting the property values in the Variable Editor while debugging, you may be accessing a property not accessed by your program causing code to run that would not otherwise be executed in your program.
Check the property get method for each variable to determine what code produces the expected update and either place this code in the get method of a property that is accessed within your program or place it in its own function and call it explicitly.