function h = save(h,filename)
%SAVE  Save Toolbox Preferences to disk

%   Author(s): A. DiVergilio
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.2 $  $Date: 2000/06/14 20:16:24 $

if nargin<2
   %---If no file name is specified, save to default preference file
   filename = h.defaultfile;
end

%---We need to save the preferences in structure 'p'
p = h.get;

%---Write preferences to disk
save(filename,'p');
