%% save output to a *.mat file

%%  Kriging Software Package  version 1.0 beta,   October 29, 1998
%%  Copyright (c) 1998, property of Dezhang Chu and Woods Hole Oceanographic
%%  Institution.  All Rights Reserved.


global platform

if status >= 3
  [filename, filepath]=uiputfile([truncated_filename '.mat'],'Save As');
  if isstr(filename) == 1
     vardef=var_defe;
     var_obs=var;var_est=Is;
     variables=' xs ys var_obs Xg Yg Cg Eg var_est model sill nugt L p b';
     variables=[variables ' Lat_long S2 markersize clr_max gammah lag'];
     variables=[variables ' TransformStatus TransformInd vardef'];
     switch PlatForm 
     case 1			% PC
       fname_str=['''' filepath filename ''''];
        cmd=['save ' fname_str variables];
     case 2 		% MAC
       fname_str=['''' filepath filename ''''];
       cmd=['save ' fname_str variables];
     case 3
       cmd=['save ' filepath filename variables];
     end
     eval(cmd)
  end
else
  disp('No Kringing Output to Save!!')
end
