Watch this Author's files
I am using Matlab R2008b and the routine was bugging because the variables PlotStartFlag and PlotBreakFlag were defined as "char" on lines 1027-1028, instead of arrays.
The bug was fixed by modifying lines 1027-1028 as :
PlotStartFlag = [ ];
PlotBreakFlag = [ ];
Thank you by the way for this very nice function :-)