Problem with properties in App Designer.

3 ビュー (過去 30 日間)
New
New 2017 年 7 月 28 日
コメント済み: Steven Lord 2017 年 7 月 29 日
Hello. I need help with "properties" in App Designer. I have some trouble with realization the method of symmetrical components.
properties (Access = public)
a = -.5 + sqrt (3) / 2 * j; % Phase-shift operator
     F = [1 a^2 a; 1 a a^2; 1 1 1]; % Matrix Fortescue
end
Message: "Invalid default value for property 'F' in class 'App1': Undefined function or variable 'a'."
If I replace "a" with "app.a" in the Matrix Fortescue.
Message: "Invalid default value for property 'F' in class 'App1': Undefined variable "app" or class "app.a"."

回答 (1 件)

Steven Lord
Steven Lord 2017 年 7 月 28 日
Since you're probably not going to want a and F to change based on the state of your app, make them Constant properties, properties with the Constant attribute.
  6 件のコメント
New
New 2017 年 7 月 29 日
編集済み: New 2017 年 7 月 29 日
No, prefix does not depend on the name of the application or classname.
Steven Lord
Steven Lord 2017 年 7 月 29 日
That is correct IF you're referring to a property of an instance of the class. A Constant property can be accessed even if you don't have an instance of the class, and the way you do that is by using the name of the class.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by