Progress bar
Insert the following line to initialise handler for the progress bar:
h = waitbar(0,'Initialising parameters...');
You may calculate the current status through the algorithm for example in a for loop using the loop variable Ci:
for Ci=0:Cstep:time
{
% calculate run number
perc = ceil(100*Ci/(time));
waitbar(perc/100,h,sprintf('%d%% calculation in progress',perc));
% useful operations
...do other stuff...
}
at the end do not forget to delete or the waitbar window will stay there the user closes it:
delete(h);