Question: Hi Im having trouble with this MATLAB code. I am supposed to reproduce the picture shown at the bottom of the second picture, not a

Hi Im having trouble with this MATLAB code. I am supposed to reproduce the picture shown at the bottom of the second picture, not a single line. Please code this in MATLAB not Octave because some of the commands in Octave dont work in MATLAB and I am not sure how to translate them because the code has to be in MATLAB. Also please divide the code as shown on the second page where Kaprekar is the driver, d=dis(x) is the Specialized Function, and data = quest(x,maxiter) is the general function. There is a description for what each function should do under their titles. Any %comments will also help so I can understand this code. Thank you so much! I will thumbs up as well. Thank you.  Hi Im having trouble with this MATLAB code. I am supposed
to reproduce the picture shown at the bottom of the second picture,
not a single line. Please code this in MATLAB not Octave because

Kaprekar's Constant A Brief Introduction to Number Theory D. R. Kaprekar (1905-1986) was an Indian mathematician, "who described several classes of natural numbers, including the Kaprekar, Harshad, and Self Numbers." He also discovered the Kaprekar Constant, which is the focus of this lab, and is the result of the following process: ( 1 ) Choose any four-digit number with at least two unique digits (ie not 1 1 11, 2222 9999): 8974 (2) Rearrange the digits in the number in descending and ascending order, forming two new numbers: 9874, 4789 (3) Subtract the smaller number from the larger number, resulting in a new four-digit number: 9874-4789 5085 (4) Using the new n umbe r resulting in step 3, repeat steps 2-3 for a maximum of seven Note: The result of step 3 may sometimes be a three-digit number, such as 999, for example, you start with the number 1000 For the sake of the process, this may be viewed as having a zero in the thousands place: 0999. This way, when you repeat step 2 you will subtract 0999 from 9990 to get 8991. Kaprekar Path of the Integer 8002 10000 443 7000 6000 5000 174 E 4000 4176 1000

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!