Problem working with 2 popupmenus

5 ビュー (過去 30 日間)
Jhon Rackham
Jhon Rackham 2019 年 8 月 30 日
コメント済み: Jhon Rackham 2019 年 8 月 30 日
Hi to everyone !
I need your help guys, i'am a beeginer in Matlab and i have a problem with my project:
Well, i have to create a program that converts whatever number set to the measures: (Kilometers, meters, centimeters and millimeters).
On mi GUI i have 2 edit text and 2 popupmenu
The idea is:
I put one numer on the edittext1 and i choose in the popupmenu1 what measure it is(Kilometers, meters, centimeters and millimeters).
Then, on the other popupmenu i choose what measure in want to convert and that value has to print on the edittext 2. is like google conversor.
I don't know how to work with 2 popupmenus, i hope you guys help me.
Have a good day. :D
jeje.png

採用された回答

Geoff Hayes
Geoff Hayes 2019 年 8 月 30 日
編集済み: Geoff Hayes 2019 年 8 月 30 日
John - have you writtin your GUI with GUIDE, App Designer, or programmatically? The solution may be similar for each: in the pushbutton callback, get the list of items in the first popup menu (you will need to access to the handle of this object). Using this same handle, get the index of the selected item. Given the index and list, you will be able to determine the initial units of the number (to convert). Repeat for the second popup menu so that you have the units to convert to.
  2 件のコメント
Jhon Rackham
Jhon Rackham 2019 年 8 月 30 日
Hi Mr Hayes. I'm new in MATLAB, I don't understand well. Can you give me a example please? Or can you help me with my project? Please. ??
Jhon Rackham
Jhon Rackham 2019 年 8 月 30 日
I'm writting my GUI with GUIDE.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by