While loop for factorial
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Javier Torrecilla Toledo
el 13 de Jun. de 2020
Comentada: Javier Torrecilla Toledo
el 13 de Jun. de 2020
I have been told to obtain the factorial of 13 using a while loop, and the solution given is the attached one. I don´t really understand why it's used that code, and would appreciate if someone could give me some explanations about it. Thanks!!
2 comentarios
Ameer Hamza
el 13 de Jun. de 2020
Use breakpoint, run the code line by line, and check the values of variables at each step. You will clearly see what is happening.
Respuestas (1)
kumar Atishay
el 13 de Jun. de 2020
Point your mouse cursor to number 5 (5th line of your code) ,click on that then you will see a red circle appears on that point.Now run the code onece more ,you will see a arrow appears on that circle along with that you will see that run command in editor window is changed ,click on the "step" option which means your code will run step by step.After every click follow the arrow and the value of facto and counter in workspace window.You will definitely able to get your code.
Ver también
Categorías
Más información sobre Variables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!