[filename, pathname] = uigetfile('HAMSR_L2*.nc', 'Select HAMSR L2 file');
ncid = netcdf.open([pathname,filename],'NOWRITE');
clear pth fname

ncid = netcdf.open([pathname,filename],'NOWRITE');
[a numVars] = netcdf.inq(ncid);
for i = 0:numVars-1
    sf = double(netcdf.getAtt(ncid,i,'scale_factor'));
    eval([netcdf.inqVar(ncid,i),'=double(netcdf.getVar(ncid,i))*sf;']);
end
netcdf.close(ncid);
clear i ncid sf a numVars


