How to write function for panel in App Designer?

조회 수: 16 (최근 30일)
SRUSHTI KHATAU
SRUSHTI KHATAU 2021년 10월 31일
댓글: SRUSHTI KHATAU 2021년 11월 15일
I want to write a code for when any of the button from particular panel in App Designer is being selected then it will print that 'panel 1 is selected'

답변 (1개)

Alamanda Ponappa Poovaya
Alamanda Ponappa Poovaya 2021년 11월 3일
You can access the panel a button was present in using the Parent property.
Firstly, give each panel an appropriate title in the component browser. Let's assume you have a panel called 'Panel One'.
In the ButtonPushed callback for every button, add the following 3 lines
s = event.Source.Parent.Title; % s = 'Panel One'
k = strcat(s, ' is selected');
disp(k)
Now when you click on the button, 'Panel One is selected' will be rpinted out to the command window.
  댓글 수: 3
Alamanda Ponappa Poovaya
Alamanda Ponappa Poovaya 2021년 11월 12일
You can refer to this link below, it has everything you need about app designer
Specifically to learn about events, refer below
SRUSHTI KHATAU
SRUSHTI KHATAU 2021년 11월 15일
Thank you.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile 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!

Translated by