using matlab The test suite assigns a random number to the v


using matlab

The test suite assigns a random number to the variable Number, Write a script that uses a while loop to repeatedly divide this number by 7 until the value remaining is less than 1. Assign the result to the variable whatsLeft. Keep track of the number of divisions required and assign to the integer variable DivisionCount.

Solution

Ans: The following script uses while loop to repeatedly to divide by 7 until remaining value < 1.

count = 0

while Number>1

Number = Number/7 % divides given number by 7

count = count + 1

end

WhatsLeft = Number % assigning result to Whatsleft

DivisionCount = int32(count)

 using matlab The test suite assigns a random number to the variable Number, Write a script that uses a while loop to repeatedly divide this number by 7 until t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site