Skip to content

Latest commit

 

History

History
26 lines (14 loc) · 473 Bytes

README.md

File metadata and controls

26 lines (14 loc) · 473 Bytes

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