Skip to content

Latest commit

 

History

History

bin2dec&dec2bin

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

bin2dec & dec2bin

Introduction

bin2dec

Write your own program to convert a binary number to decimal number.

You cannot use any MATLAB number conversion function.

Start your program like this:

function a_dec=Mybin2dec(a_bin, n)

a_bin is a binary number and n is the number of digits.

dec2bin

The reverse of the above.

Start your program like this:

function a_bin=Mydec2bin(a_dec)

Work cited

Question 3, Lab1, VG101, Jigang Wu, FA2015 & FA2016