freehanddraw
Draw smooth lines freehand on images or plots; return the handle and xy data of the line object.
Author: Brett Shoelson
Very nice work!
Noticed a small issue, which may only occur in recent (R2009a) releases: The DoubleBuffer property seems not always present in the oldvals structure at line 82. This could be solved by moving it to a separate line:
if isfield(oldvals, 'DoubleBuffer')
set(gcf,'doublebuffer',oldvals.DoubleBuffer);
end
Nice function! I think there is a minor issue with the double backslash escaping. You can get rid of all the double backslashes by changing the fprintf-line from:
fprintf(fid,t)
to
fprintf(fid,'%s\n',t);