필터 지우기
필터 지우기

Create multiple checkbox in a loop

조회 수: 13 (최근 30일)
Kishore Pushparaj
Kishore Pushparaj 2023년 3월 16일
답변: Raghunathraju 2023년 3월 28일
Hi i am creating a gui that measure temperture vs time for 1 hr and save each loop in a new workbook. i need to create a new check box after each loop is completed
eg: if filename is loop_1...to...loop_n, then a new checkbox should be created and saved in the same name of the each workbook and show that in plot when its checked
thanks in advance

답변 (1개)

Raghunathraju
Raghunathraju 2023년 3월 28일
Hi Kishore,
As per my understanding, you want to create multiple checkboxes in a loop and have the same name as the loop.
You can refer the code below; Here I have created five checkboxes for five iterations of the loop where each checkbox is created after each iteration.
a=uifigure("Name",'Temp vs Time');
text='loop %d';
for w=1:5
l=sprintf(text,w);
uicheckbox(a,"Text",l,"Position",[70*w 80 84 22]);% you can alter the position
end
For more information refer to MathWorks Documentation

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by