MATLAB: Infinite loop loops Please tell me how to stop running a script that is in an infinite loop without quitting Matlab? Best Answer CTRL+C should normally stop such a script, unless you're calling a MEX function. Related SolutionsMATLAB: Loop runs infinitely, Since total is random numbers, it will never equal exactly 1, so see if it exceeds 1 insteadif total >= 1Of check within a toleranceif abs(total-1) < someSmallNumberPlease read the FAQ for more info: http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F MATLAB: Converting for loop to while loop for i =1:5 j=1; k=1; while j<=5-i fprintf(' '); j = j+1; end while k<=i fprintf('*'); k = k+1; end fprintf('\n')end Related QuestionNeed helping finding the source of the forever loop in the codeIs an infinite for loop infinite
Best Answer