Question: A positive integer x expressed in decimal ( base 1 0 ) can be expressed using binary ( base 2 ) by repeatedly dividing x

A positive integer x expressed in decimal (base 10) can be expressed using binary (base 2) by repeatedly dividing x by 2 and determining the remainder. The binary value is then constructed using the remainders written in reverse order. For example, to express 19 as a binary number
192=9 remainder 1
92=4 remainder 1
42=2 remainder 0
22=1 remainder 0
12=0 remainder 1
So 19 expressed as a binary number is 10011.
Write a function called binary (x) that takes in the input argument of a positive integer x and returns a string of the value of x expressed as a binary number using MATLAB.
A positive integer x expressed in decimal ( base

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!