Why does a MATLAB Class not update Properties unless debugging it?

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?

 Accepted 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.

More Answers (0)

Categories

Find more on Function Creation in Help Center and File Exchange

Products

Release

R2017a

Community Treasure Hunt

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

Start Hunting!