This is about 'UI Drop-down'
#List Change
%// I recommend to make the first DD menu be a blank.
%// (Matlab does not recognize the selected DD list index as the menu is changed)
%// (Therefore, i should induce the user to reselect.)
DropDownList1 = {'', 'A_Menu_1', 'A_Menu_2', 'A_Menu_3'};
DropDownList2 = ["", "B_Menu_1", "B_Menu_2", "B_Menu_3"];
TaskOrder = 'Work_A';
if (strcmp(TaskOrder, 'Work_A'))
app.DropDown.Items = DropDownList1;
elseif (strcmp(TaskOrder, 'Work_B'))
app.DropDown.Items = DropDownList2;
end
#Proceed according to the selected D.D. menu
if (strcmp(TaskOrder, 'Work_A'))
if (strcmp(app.DropDown.Value, DropDownList1(2)))
disp('A_Menu_1');
elseif (strmp(app.DropDown.Value, DropDownList1(3)))
disp('A_Menu_2');
elseif (strmp(app.DropDown.Value, DropDownList1(4)))
disp('A_Menu_3');
end
elseif (strcmp(TaskOrder, 'Work_B'))
if (strcmp(app.DropDown.Value, DropDownList2(2)))
disp('B_Menu_1');
elseif (strmp(app.DropDown.Value, DropDownList2(3)))
disp('B_Menu_2');
elseif (strmp(app.DropDown.Value, DropDownList2(4)))
disp('B_Menu_3');
end
end
#Matlab
#Matlab App Designer
'Memo > Matlab' 카테고리의 다른 글
Matlab : Make & Write Data in PPT file (without PPT API) (0) | 2022.08.09 |
---|---|
Matlab function : Save and load UI values in text (0) | 2022.08.08 |
Matlab function : Update the Text Area with part of a text file (0) | 2022.08.02 |
Matlab function : Path Checker (0) | 2022.08.01 |
Matlab function : Text Area(History log) updater (0) | 2022.08.01 |