How can I specify that dlmwrite write to a textfile with the name of an input?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2015-11-7
编辑:Walter Roberson
2015-11-7
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!