Why does %c not read whitespaces with the TEXTREAD function?
Mostrar comentarios más antiguos
Why does %c not read whitespaces with the TEXTREAD function?
I am trying to read a file using TEXTREAD. Here is an example input file:
one two three four
one two three four
I should be able to read this file using
[a, b] = textread('file', '%3c%3c%*[^\n]');
and expect the output to be:
a=[ 'one'; 'one' ] and
b=[ ' tw'; ' tw'; ]
But I get
a=[ 'one'; 'one' ] and
b=[ 'two'; 'two' ]
It appears that the whitespace between the 'one' and 'two' is skipped.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!