textread function parameters help
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MENGZE WU
am 15 Dez. 2021
Kommentiert: Walter Roberson
am 15 Dez. 2021
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?
0 Kommentare
Akzeptierte Antwort
Voss
am 15 Dez. 2021
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 Kommentar
Walter Roberson
am 15 Dez. 2021
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!