Question: function v = rebaseInteger(n,b,m) Question 1. Write a Matlab function that converts a non negative integer written in decimal base to its equivalent form expressed

 function v = rebaseInteger(n,b,m) Question 1. Write a Matlab function that

function v = rebaseInteger(n,b,m)

Question 1. Write a Matlab function that converts a non negative integer written in decimal base to its equivalent form expressed on an arbitrary base b10. Store the output in a vector. On input, the function must accept the number n, the base b, and the maximum number of digits m. On output, the function must return a vector of length m. If the number causes an overflow (i.e., it is bigger than what can be represented with m digits on that base), the vector must be filled with NaNs. The program must check that b>1. If b1 it must return a vector of 1 's. The return expression must contain the Most Significant Digit in the first entry of the vector. For example, if the number is 99=181+29, the base is 3 and m=7, then the answer is [0010200]. For the same number, but the base is 5 and m=4

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!