create static method in app designer

조회 수: 25 (최근 30일)
dleal
dleal 2022년 6월 29일
답변: Cris LaPierre 2022년 6월 29일
Hi all,
How do I create static methods in the App Designer? The dropdown menu only allows me to create either public or private functions.
I couldn't find any explicit documentation about this.

채택된 답변

Cris LaPierre
Cris LaPierre 2022년 6월 29일
I'm assuming you want a static method so that the first input does not have to be an object of the class. The way I could do this was to manually create a 'methods (Static)' section below my app properties. This is the same place a custom function (public or private) would appear. For example
properties (Access = private)
x
end
methods (Static)
function out = myFxn(in)
out = 2*in;
end
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by