How can I specify that dlmwrite write to a textfile with the name of an input?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Real Name
el 7 de Nov. de 2015
Editada: Walter Roberson
el 9 de Nov. de 2015
For example, I want to write a text file to a directory using dlmwrite, and I want to name the text file as the inputted name. I have:
dlmwrite('/home/mydirectory/auxiliaryData',output, 'delimiter','\t','precision',10 );
and a couple of lines of code ago, I had:
auxiliaryData = input('Input Auxiliary Channel: ');
I don't want the name of the text file to be the name of the variable (auxiliaryData).
0 comentarios
Respuesta aceptada
Walter Roberson
el 7 de Nov. de 2015
Editada: Walter Roberson
el 7 de Nov. de 2015
projectdir = '/home/mydirectory';
dlmwrite( fullfile(projectdir, auxiliaryData),output, 'delimiter','\t','precision',10 );
You might prefer using
auxiliaryData = input('Input Auxiliary Channel: ', 's');
... I'm not really sure what data type you intend, or what file extension you intend.
4 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Text Files en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!