Make a program to convert a number to decimal, octal, hexadecimal and binary value

6 views (last 30 days)
Hi guys, i really need your help with my project:
I need a program that convert a number to decimal, binary, hexadecimal or octal value.
I'am working on GUI and i have on my GUIDE the next things:
2 popupmenu
2 edittext
Well, i was thinking i could do a simple conversor (like google conversor).
And the edittext1 i enter the number to convert, then i choosee on the popupmenu1 what value is it(it can be decimal, binary, hexadecimal or octal value)
after that, i choose on the popupmenu2 what value i wanna convert and that value will be set on the edittext2.
I'am a beginner here,guys i hope you can help me with the code, please, help me with a code with the native variables(like edittext, popupmenu, etc).
Thanks ☺
I've attached a pic of my GUI.
  2 Comments
Jan
Jan on 9 Sep 2019
The question is very general. Please ask a specific question to allow us to post an answer.
Stefany Romero
Stefany Romero on 9 Sep 2019
I need the code for make the conversor Mr. :(
I'am a beginner and i don't know how to do it. Can you help me please?

Sign in to comment.

Accepted Answer

Fabio Freschi
Fabio Freschi on 9 Sep 2019
You can use the functions
bin2dec
dec2bin
hex2dec
dec2dex
and the more general
dec2base
base2dec
  7 Comments
Fabio Freschi
Fabio Freschi on 9 Sep 2019
switch clause evaluate an expression, but your check is rather complicate. IMO a multiple if is simpler

Sign in to comment.

More Answers (0)

Categories

Find more on App Building 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!