how to export numerical values to ASCII format

72 次查看(过去 30 天)
Actually I am having a hard time to do it. I use R nowadays i forgot how to export my data in matlab. I searched and I could not find a way to do it.
I tried
save('TheNameYouwant.txt','TheNameOfFile', '-ascii');
but this is not what I want. I want to have the output as Tab Delimited text
  1 个评论
shima inanloo
shima inanloo 2019-8-1
hi niki !
try this :
foe example, you have the result Zx and the input variables are X :
A = [X;Zx];
fileID = fopen('f.txt','w');
fprintf(fileID,'%6s %12s\n','X','A');
fprintf(fileID,'%6.2f %12.8f\n',A);
fclose(fileID);
I hope it will help you.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2016-11-4
Try dlmwrite
dlmwrite('TheFileNameYouWant.txt', yourMatrix, '\t');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by