Question: MATLAB Algorithm 9 Write a function with the header [b] -myDec2Bin(d) where d is a positive integer in decimal (base 10), and b is the

MATLAB  MATLAB Algorithm 9 Write a function with the header [b] -myDec2Bin(d)

Algorithm 9 Write a function with the header [b] -myDec2Bin(d) where d is a positive integer in decimal (base 10), and b is the binary representation of d. The output b must be a row vector of ones and zeros, and the leading term must be a 1 unless the decimal input value is 0 Hint: rem() and floor) are both useful functions to use within this function Test cases: Hint: use a while loop to find the first 2x power that is higher than the decimal value, d. This will let you know where to start doing your calculations

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 Databases Questions!