I am using the following code to calculate a given parameter. I have included a progress bar for testing purposes and I noted that it always sticks at 19%. Upon further snooping around, I realize the for loop does not stop but greatly slows down after 19% even though the progress bar says only 2 min 33 secs left.
I am not running out of memory (checking with top command in the terminal) and there seems to be nothing odd about the data/anything different from surrounding data.
testcase1 = single(zeros(length(lon),length(lat),length(time)));testcase2 = single(zeros(length(lon),length(lat),length(time)));progressbarfor i = 1:length(lon);for j = 1:length(lat);for t = 1:length(time);if C(i,j,t) >= -500 && C(i,j,t) <= -12testcase1(i,j,t) = A(i,j,t)*(0.35*((-(B(i,j,t)/(K*C(i,j,t))))^(2/3)) + (2 -(10/B(i,j,t))))^(1/2);elsetestcase2(i,j,t) = 2*A(i,j,t)*((1 -(10/B(i,j,t)))^(1/2));endendendprogressbar(i/121) % Update progress barend
Any ideas why this would stick/slow down here?