textread function parameters help

3 次查看(过去 30 天)
Data = textread(fullfile(fNames(i).folder, fNames(i).name), '', -1, 'headerlines', 2);
I got this matlab code, however, I can't figure out what ' ', -1 part means. Could anyone help me with that?

采纳的回答

Voss
Voss 2021-12-15
As far as I can tell from reading the documentation for textread, those input arguments don't do anything special. They merely explicitly tell textread to do the default stuff ('' means don't skip any particular characters and -1 means read the whole file). It looks like the -1 can be omitted, but the '' (format specifier) needs to remain.
  1 个评论
Walter Roberson
Walter Roberson 2021-12-15
Using '' as the format is an undocumented option. It causes textread() to examine the first line of input (after any skipped headers) to try to figure out what the format of the file is.
If I recall correctly, when '' is used for the format, and other undocumented parameters are not used, then the inputs must be numeric. At the moment I do not recall whether comma separators are supported in this mode.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

标签

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by