Effacer les filtres
Effacer les filtres

textread function parameters help

1 vue (au cours des 30 derniers jours)
MENGZE WU
MENGZE WU le 15 Déc 2021
Commenté : Walter Roberson le 15 Déc 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?

Réponse acceptée

Voss
Voss le 15 Déc 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 commentaire
Walter Roberson
Walter Roberson le 15 Déc 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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Tags

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by