From MATLAB®, you can connect to an FTP server to perform remote file operations. The following procedure uses a public MathWorks FTP server (ftp.mathworks.com). To perform any file operation on an FTP server, follow these steps:
Connect to the server using the ftp function.
Perform file operations using appropriate MATLAB FTP functions. For all operations, specify the server object. For a complete list of functions, see the FTP reference page.
List the contents of the MathWorks FTP server and retrieve a file named README To view the file, use the type function.
tmw = ftp('ftp.mathworks.com'); dir(tmw) mget(tmw, 'README'); type README
README contains the following text:
Welcome to the MathWorks FTP site! The MathWorks FTP site has a new structure: /incoming - where you upload files to /outgoing - where you pick up files from NOTE: Files in the above directories will be removed after 30 days. You may also want to visit the MathWorks Web site at http://www.mathworks.com Send questions/comments/suggestions to firstname.lastname@example.org
View the contents of the pub folder:
cd(tmw, 'pub') dir(tmw) % Close the connection close(tmw)