%% Simple example to Get survey data out of netcdf

NetCDFfilename='Vlugtenburg.nc';

line=21 % number of transect line(s) 2 be extracted (value(s) between 1 and 22)

datewindow=1:5:22  %Index of the survey(s) that you are interested in. to be replaced by a real window in time like : from 1-May-2009 to 20-Jun-2009. But first the Net CDF field of the time has to be fixed


nc_dump(NetCDFfilename);  % give a quick overview of the contents

figure
hold all 

x=nc_varget(NetCDFfilename,'cross_shore',[0],[-1]);

for idate=datewindow
    for itransect=line
        alt=nc_varget(NetCDFfilename,'altitude',[idate-1 itransect-1 0],[1 1 -1]);   % index -1 because netcdf starts counting at zero.. Weird Yanks.
        plot(x,alt)
    end
end

