Watch this Author's files
very good! please also add color change:
%define colors colors={'k',[0 0 1]};
%in your function: %... if ischar(colors{m})==1 set(lines(k),'color',char(colors{m})); else set(lines(k),'color',colors{m}); end %...
Contact us at files@mathworks.com