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
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
Get step-by-step solutions from verified subject matter experts
