I am trying to replace a integer n if odd by 3 times value plus one or if even replace by half the value and count the steps but the counting does not seem to occur properly

 Réponse acceptée

You have "m=1" as the first thing happening inside the while loop, so you keep resetting the count to 1.

Catégories

En savoir plus sur Entering Commands dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by