Set FTP transfer type to ASCII
ascii(ftpobj) sets the download and upload FTP mode to ASCII, which converts new line characters. Use this method only for text files, including HTML pages and Rich Text Format (RTF) files.
FTP object created by ftp.
Connect to the MathWorks® FTP server, and switch from binary (default) to ASCII mode: