MATLAB importdata函数返回值类型

importdata函数是MATLAB中I/O文件操作的一个重要函数。需要注意的是,针对不同的文件内容,importdata函数的返回值类型也有所不同。

MATLAB帮助文档中的详细说明如下:

Based on the file format, importdata selects and calls a helper function to read the data. When the helper function returns more than one nonempty output, importdata combines the outputs into a struct array.

For ASCII files and spreadsheets, importdata expects to find numeric data in a rectangular form (that is, like a matrix). Text headers can appear above or to the left of the numeric data, as follows:

Column headers or file description text at the top of the file, above the numeric data.

Row headers to the left of the numeric data.

To import ASCII files with nonnumeric characters anywhere else, including columns of character data or formatted dates or times, use textscan instead of importdata. For more information, see Import Mixed Text and Numeric Data from a Text File.

When importing spreadsheets with columns of nonnumeric data, importdata cannot always correctly interpret the column and row headers.

If the ASCII file or spreadsheet contains either column or row headers, but not both, importdata returns a colheaders or rowheaders field in the output structure, where:

colheaders contains only the lowest line of column header text. importdata stores all text in the textdata field.

rowheaders is created only when the file or worksheet contains a single column of row headers.

转载于:https://www.cnblogs.com/yuthreestone/p/3557351.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值