clear all
filein = 'Endeavour_prelim.grd';

% Open example file.
ncid   = netcdf.open(filein,'NC_NOWRITE');

[ndims,nvars,ngatts,unlimdimid] = netcdf.inq(ncid);

attname = netcdf.inqattname(ncid,netcdf.getConstant('NC_GLOBAL'),0);

% Get the name of the z (3rd) variable.
[varname, xtype, varDimIDs, varAtts] = netcdf.inqVar(ncid,2);

% Get variable ID of the first variable, given its name.
varid = netcdf.inqVarID(ncid,varname);


% Get the value of the first variable, given its ID.
data = netcdf.getVar(ncid,varid);

data=double(data);
% pcolor(data)
% shading interp
% axis image

F=1/81*ones(9,9);
D_filt = filter2(F,data);

surfl(D_filt')
shading interp
colormap gray
view(0,90)
axis image
