function SaveCurve(curve)

global CURDIR

% save dlg box
cd(CURDIR); 
[FILENAME, PATHNAME] = uiputfile('*.mat', 'Save Curve');
if (~ischar(PATHNAME) & PATHNAME==0) | (~ischar(FILENAME) & FILENAME==0)
    % cancel pressed
    return;
end
pathfilename = strcat(PATHNAME, FILENAME);
CURDIR = PATHNAME;

if ~isempty(pathfilename)
    save(pathfilename, 'curve');
end

