function saveasmmat( h, name )
%SAVEASM Save Figure as an M-file and MAT-file for property values

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.4 $  $Date: 1998/11/18 04:50:39 $

% remove ext from filename so appropriate M-file / MAT-file pairs get generated
[path, name, ext] = fileparts(name);

if ~isempty(find(name == '.'))
    error(['Invalid m-file name: ' filename ', . (dot) is not valid filename character.']);
end

hardcopy(h, '-dmfile', fullfile(path, name));
