% printgif(varargin) prints gif files in matlab
% printgif accepts all print arguments in varargin.
% printgif ignores all printer drivers passed to it
% ('-deps', '-dtiff', etc.)
% instead it used the -djpeg100' driver and converts
% the resulting jpg file to a gif using
% prints the file foo.gif
This is a nicely written file with good help, an H1 line and helpful comments in the code. I have a few suggestions if you want to make your function a little more like a MathWorks function.
You may wiant to consider changing the name. When I first saw your submission I thought it was for sending a gif file to a printer. Some alternate names might be fprintgif, writegif, or imwritegif.
Your file has an all lowercase name. This is the standard case for MathWorks api functions. The MathWorks uses an uppercase version of the function name on the H1 line without the argument list. This makes the H1 line stand out and without the arguments list there is more room for the description on the H1 line.
The MathWorks help usually follows the H1 line with some form of syntax help for calling the function and descriptions of the required inputs. You may want to consider explicitly naming the required inputs figure, and filename and checking that they are correct and then explaining them in the help.
The MathWorks includes a See Also section in their help. In this case you may want to reference print, imread, and imwrite.
Your help text is indented one space more than what The MathWorks uses.