Why can dlmread not open a file created with dlmwrite?

3 visualizaciones (últimos 30 días)
Jeroen
Jeroen el 1 de Dic. de 2017
Comentada: Ethan Knights el 19 de Mzo. de 2021
Hi I created and .txt file with the function dlmwrite in order not to rerun the previous code for collecting values from over a 1 000 files. The file is created from the 1701733x23 matrix (numeric).
When the same file is imported in and other script the error:"DELIMITER must be a single character." is displayed.
The code (from command window):
>> dlmwrite('Erzberg_All_Raw_Data_MWD_new.txt',MWD_Data_All2,'delimiter',',');
>> MWD_Data_All2=dlmread('Erzberg_All_Raw_Data_MWD_new.txt','delimiter',',');
Error using dlmread (line 75)
DELIMITER must be a single character.
The same happens if i use a tab as delimiter.
The work is done in the same computer and same matlab version (only different scripts).
Any explanation or a suitable work around? Can it be caused by a clogged RAM (nearly all space is used)?
Cheers Jeroen
  4 comentarios
per isakson
per isakson el 1 de Dic. de 2017
Editada: per isakson el 1 de Dic. de 2017
Yes, isn't it? There is, however, an explanation. Matlab has been a commercial product for 30+ years and before that a teaching tool for ten years. The Mathworks does a good job in morphing Matlab to keep up with time and at the same time provide backward compatibility.
dlmread still stays with the old syntax. dlmwrite honors the old syntax; it works without the new keyword, delimiter. I bet, dlmread will understand the new keyword, delimiter, in a year or two.
btw: This was the first time I noticed the new keyword, delimiter, with this function.
Ethan Knights
Ethan Knights el 19 de Mzo. de 2021
I just wound up here by making a similar mistake ~3 years later - give it a few more years for the transition!

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by