seriallist
(将删除)连接到您的系统的串行端口列表
不推荐使用 seriallist
。请改用 serialportlist
。有关更新代码的详细信息,请参阅兼容性考虑。
说明
seriallist
返回系统上所有串行端口的列表。该列表包括由 USB 转串行设备和蓝牙串行端口配置文件设备提供的虚拟串行端口。这提供了您可以在计算机上访问并可用于串行端口通信的串行端口列表。
示例
显示串行端口的列表
seriallist
函数显示系统上所有串行端口的列表。
显示可用的串行端口。
seriallist
ans = 1x2 string array "COM1" "COM3"
现在,您可以创建 serial
对象,并通过串行端口通信。
版本历史记录
在 R2017a 中推出R2022a: 警告
不推荐使用 seriallist
。请改用 serialportlist
。
此示例说明如何使用推荐的功能查看串行端口设备。
功能 | 请改用以下项 |
---|---|
s = seriallist ans = "COM3" | s = serialportlist ans = "COM3" |
有关使用推荐功能的详细信息,请参阅Transition Your Code to serialport Interface。
R2021b: 将删除
seriallist
函数运行而没有发出警告,但代码分析器指示将在以后的版本中删除 seriallist
。
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)