%% List Contents of Folder
% List the contents of a folder and a subfolder on an FTP server.
% First, connect to the National Centers for Environmental Information (NCEI) FTP server.

ftpobj = ftp('ftp.ngdc.noaa.gov')

%
% List the contents of the current folder on the server. At the start of a session, the current folder is the highest level folder to which you have access.

dir(ftpobj)

%
% Specify a subfolder and list its contents.

dir(ftpobj,'pub')

%
% FTP service courtesy of the National Centers for Environmental Information (NCEI). See the NCEI Privacy Policy, Disclaimer, and Copyright for NCEI terms of service.
% Copyright 2012 The MathWorks, Inc.