Effacer les filtres
Effacer les filtres

how to export numerical values to ASCII format

72 vues (au cours des 30 derniers jours)
Niki
Niki le 4 Nov 2016
Commenté : shima inanloo le 1 Août 2019
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 commentaire
shima inanloo
shima inanloo le 1 Août 2019
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.

Connectez-vous pour commenter.

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by