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?

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2019년 9월 12일

0 개 추천

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.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Function Creation에 대해 자세히 알아보기

제품

릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by