close
关闭与 SFTP 或 FTP 服务器的连接
语法
说明
示例
关闭连接
打开到 FTP 服务器的连接。在会话结束后再将其关闭。
首先,连接到美国国家环境信息中心 (NCEI) 的 FTP 服务器。
s = ftp('ftp.ngdc.noaa.gov')
FTP with properties: Host: "ftp.ngdc.noaa.gov" Username: "anonymous" Port: 21 ServerLocale: "en_US" DirParserFcn: @matlab.io.ftp.parseDirListingForUnix Mode: "binary" LocalDataConnectionMethod: "passive" RemoteWorkingDirectory: "/"
显示服务器上的内容,并检索 README.txt
文件。
dir(s)
DMSP coastwatch international INDEX.txt dmsp4alan ionosonde README.txt ftp.html mgg STP geomag pub Snow_Ice google12c4c939d7b90761.html wdc Solid_Earth index.html
mget(s,'README.txt');
关闭与 FTP 服务器的连接。
close(s)
FTP 服务由美国国家环境信息中心 (NCEI) 提供。有关 NCEI 服务条款,请参阅 NCEI 隐私政策、免责声明和版权。
输入参数
s
— 连接到 SFTP 或 FTP 服务器
SFTP 对象 | FTP 对象
与 SFTP 或 FTP 服务器的连接,指定为 SFTP 对象或 FTP 对象。
提示
如果在会话结束时未运行
close
,则连接将自动超时或在您退出 MATLAB® 时终止。close
不返回任何输出以指示成功或失败。
版本历史记录
在 R2006a 之前推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)