how can i prevent bogus values while executing a loop consist of variables?
Mostrar comentarios más antiguos
sir, In my program there is a loop having both starting and ending values are variable which is called earlier in the program.when executing i got bogus value as result.but when i give the values of the variables directly just before the loop i got correct result.why this happens?how can i solve this? concerned loop in my program is attached here..n my problem is the result obtained as "sumB"..in that the variables "g" and "h" was obtained earlier
Respuestas (1)
Thorsten
el 5 de Nov. de 2015
0 votos
Have you checked the value of sumB before the loop? Maybe you assume sumB to be 0 but it is not from a previous run of the loop.
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!