textread
读取文本文件中的数据;写入多个输出
注意
不推荐使用 textread
。请改用 textscan
。
语法
[A,B,C,...] = textread(filename,format)
[A,B,C,...] = textread(filename,format,N)
[...] = textread(...,param,value,...)
说明
[A,B,C,...] = textread(filename,format)
以指定的 format
将数据从文件 filename
读入到 A
、B
、C
等变量中,直到整个文件读取完毕。将 filename
和 format
输入指定为字符向量或字符串标量。textread
对于读取已知格式的文本文件非常有用。textread
可处理固定格式文件和任意格式文件。
注意
读取大型文本文件、从文件中的特定点读取或将文件数据读取到元胞数组而非多个输出时,您可以首选使用