%% Close Connection
% Open a connection to an FTP server. Then close it when your session is finished.
% First, connect to the National Centers for Environmental Information (NCEI) FTP server.

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

%
% Show the contents on the server, and retrieve the README.txt file.

dir(ftpobj)

%

mget(ftpobj,'README.txt');

%
% Close the connection to the FTP server.

close(ftpobj)

%
% 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.