필터 지우기
필터 지우기

How to assign value to a constant or static class property

조회 수: 5 (최근 30일)
Ming Chao
Ming Chao 2021년 11월 5일
I wrote a test code to set a Static property (Constant, as recommended) in MyClass, as TestStatic. In TestStatic I call a static method in MyClass, setA(), to change the value of one of the constant properties. When I stop then pass over the line
MyClass.m_a = aNewA;
I can see that the variable changed value. But after I step out from the function setA(), the value returned to the default.
May I ask what I did run and what should be the fix?
In the test code, the program should start from TestStatic.
Thanks.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by