
Originally Posted by
jfortiv
Hi,
I've been working on a simulation for a little while now. I'm to the point where I'm trying to run the simulation for a longer time period (I mean physical time represented in the simulation) than before, and I'd like to be able to track the progress of the calculation as it loops over the time vector.
I tried doing this with disp():
for j=1:length(t) %loop over time
if(rem(j-1,100)==0) %print progress every 100 time points
disp('time = ')
disp(t(j))
disp('out of ')
disp(tfinal)
Unfortunately, it seems like MATLAB performs all of the calculations in the for loop first and then spits out the disp() arguments after all is said and done. This doesn't accomplish my desired task. I'm finding this unexpected, as I've implemented similar progress tracking techniques in python using print statements.
Does anyone know how to track progress in a loop?
Thanks!