type
显示文件内容
说明
示例
输入参数
filename
— 文件名
字符向量 | 字符串
要显示的文件名,指定为字符向量或字符串。filename
可以是绝对路径或相对路径,并且可以包含路径和文件扩展名。type
支持带有以下扩展名的文件名,带有任何其他扩展名的文件都被视为纯文本。
文件扩展名 | 说明 |
---|---|
.mlx | MATLAB 实时脚本 - 使用 MATLAB 实时编辑器创建的交互式文档 |
.mlapp | MATLAB App 文件 - 使用 MATLAB App 设计工具创建的 App |
.m | MATLAB 代码 - MATLAB 脚本、函数或类 |
如果您不指定文件扩展名,也不存在无扩展名的文件,则 type
假定扩展名为 .mlx
、.mlapp
或 .m
。例如,如果存在文件 myscript.m
,type myscript
命令将显示该文件的内容。
type
利用自动字符集检测来确定 MATLAB 代码 (.m) 和其他文本文件的文件编码。
扩展功能
基于线程的环境
使用 MATLAB® backgroundPool
在后台运行代码或使用 Parallel Computing Toolbox™ ThreadPool
加快代码运行速度。
此函数完全支持基于线程的环境。有关详细信息,请参阅Run MATLAB Functions in Thread-Based Environment。
版本历史记录
在 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)