matlab get stop executing while loop for no reason
Mostra commenti meno recenti
Hello everyone:
I am facing a strange problem with Matlab. I have a while loop that should execute optimization function "fminmax". The problem is that suddenly the program stop working it is like it froze. It does not finish the execution, it does not end it also, nothing..as shown in figure bellow.

Does anyone here have an idea why this happen????
Thank you in advance.
9 Commenti
Weird Rando
il 4 Mag 2016
Modificato: Weird Rando
il 4 Mag 2016
You're just stuck in an infinite loop. Chance are that the variable may not be meeting the condition you set for the while loop.
meriame
il 4 Mag 2016
Jan
il 4 Mag 2016
The screenshot does not contain any useful information. Please restart Matlab and/or the computer to check, if the problem is reproducible. If so, post the relevant part of the code. Perhaps you only requested a rand(1e6) and the computer stalls while trying to reserve a 10 TByte array.
CS Researcher
il 4 Mag 2016
Print your maxfval and see if it ever gets smaller than the epsilon. If not, increase the epsilon.
meriame
il 4 Mag 2016
CS Researcher
il 4 Mag 2016
What is the error message? Have you initialized j somewhere in the code? Also, there should be a ';' between maxfval=abs(maxfval) and j=j+1
meriame
il 4 Mag 2016
CS Researcher
il 4 Mag 2016
Well then it seems that maxfval becomes smaller than epsilon in the first run. Try changing epsilon. It would be easier for me to understand if you can share the entire code.
Risposte (0)
Categorie
Scopri di più su Introduction to Installation and Licensing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!