How to use a popup menu to link a number in MATLAB GUIDE?
1 view (last 30 days)
Show older comments
Hello, I have a question about popup menu. Right now, I want the user to choose the wheel size in the popup menu. So the there are few choices in the menu such as 20*8-11, 21*8-10 ..... However, I want use the wheel size to do the later on calculation in a sub function.It is impossible to do calculation with something like a string (eg.20*8-11). So how do I give the out put as Wheel_Size=20; Rim_Size=11, if the user select the 20*8-11 in the popup menu?
Thanks a lot
Kevin Tran
0 Comments
Accepted Answer
Image Analyst
on 22 Nov 2015
You can put those strings into the popup with code, or, if you know that they will be the same on every run, then just edit the string property of the popup in GUIDE. Then just get the value and switch or use an if:
selectedItem = get(handles.popup1, 'Value');
switch selectedItem
case 1
% 20*8-11 - do something....
case 2
% 21*8-10
end
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!