152k views
3 votes
Write matlab programs to convert the following to binarynumbers.

a) 23
b)87
c) 378
d)2388

User Muescha
by
4.9k points

1 Answer

1 vote

Answer:

decimal_no = 23;

binary_no = dec2bin(decimal_no);

matlab answer=10111 /*it is a string in matlab*/

now you just have to change the values of decimal_no

On putting 87

the answer is 1010111

On putting 378

the answer is 101111010.

On putting 2388

the answer is 100101010100.

Step-by-step explanation:

We have used the inbuilt function in matlab dec2bin(decimal Number) it returns the binary number as a string.

User Hafez Divandari
by
5.0k points