How can I use Structures array the App Designer Properties?
조회 수: 27 (최근 30일)
이전 댓글 표시
I have a problem using structures in the App Designer properties. I'm new on App Designer and I would like to have some common variables to all the callback functions. In the original script that I'm using, these variables where ordinated in a structure but I'm not able to do the same in the App Designer. The error it is relative to the use of the dot when I write a structure array.

How can I solve this problem and to continue using structures also in App Designer?
댓글 수: 0
채택된 답변
Cris LaPierre
2020년 1월 8일
All properties you define are added to the app structure. This is accessible and passed to all functions, callbacks, etc.
댓글 수: 0
추가 답변 (1개)
mansour torabi
2021년 10월 1일
편집: mansour torabi
2021년 10월 1일
To define a structure variable as a public Propertey in the App Designer, use struct function:
properties (Access = public)
YourPublicVariable = struct('FieldName1',Value1,'FieldName2',Value2);
end
Then anywehere in the App designer code, your defined variable can be accessed using app variable:
function SomeOtherFunction(app)
YourValue1 = app.YourPublicVariable.FieldName1;
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!