Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

While loop doesnt run

2 visualizaciones (últimos 30 días)
Natalia Wong
Natalia Wong el 1 de En. de 2016
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
im having problems with my code. if the user enters anything except the value 1 the program should stop but if the user enters 1 the program should continue like in the while loop. But my program stops even if the user enters 1. Pls help Thanks

Respuestas (1)

Jan
Jan el 1 de En. de 2016
Except for the problem, that I do not have CompTrap and CompSimp, your code runs as expected on my computer.
The message "Program terminated." is confusing. It looks strange, that the code contains the part for the integration twice. But at least nothing stops.
I suggest to use the debugger to step through your code line by line. Then it should be easy to find out, what's going on.
  2 comentarios
Natalia Wong
Natalia Wong el 2 de En. de 2016
how to use debugger?
Image Analyst
Image Analyst el 2 de En. de 2016
Natalia, it will be easier after you look at this: http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by