Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

*need help with converting \"(9)\" into two MATLab functions. the rest is just e

ID: 671950 • Letter: #

Question

*need help with converting "(9)" into two MATLab functions. the rest is just extra info if needed

Now practice the following conversions in number system (do them by hand):

(1) 11100111 (binary) à decimal = (2) 11100111 (binary) à hexadecimal = (3) 1000 (decimal) à binary = (4) 1000 (decimal) à hexadecimal = (5) 3F7C (hexadecimal) à decimal = (6) 3F7C (hexadecimal) à binary = (7) 13.625 (decimal) à binary = (8) 101.11 (binary) àdecimal =  


You can confirm your answers to the above problems by using built-in functions bin2dec, dec2bin, hex2dec, and dec2hex. There are no functions called bin2hex or hex2bin.


(9) Create your bin2hex and hex2bin as anonymous functions in MATLAB

Explanation / Answer

1.bin_str = '11100111'

bin_str =

11100111

>> dec_str =bin2dec(bin_str)

2.

bin_str = '11100111'

bin_str =

11100111

>> hex_str = dec2hex(bin2dec(bin_str))

hex_str =E7

3.dec_str = 1000
bin_str =dec2bin(dec_str)

4.dec_str = 1000
hex_str =dec2hex(dec_str)

5.hex_str ='3F7C'
dec_str =hex2dec(hex_str)