How can i export a data to tab (10 character space) separated text file...
Afficher commentaires plus anciens
I have a n*m matrix at matlab and i need to export them to a txt file and it is important to have 2 features:
1- data should be separated by tab(\t)
2- they have to be scientific number with 8 number precision at this format 0.00000000
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 23 Juin 2013
fmt_item = '%f.8';
delim = '\t';
nl = '\n';
fmt = [repmat( [fmt_item delim], 1, size(YourMatrix,2)-1 ), fmt_item, nl];
fid = fopen('YourOutput.txt', 'wt');
fprintf(fid, fmt, YourMatrix .' );
fclose(fid);
2 commentaires
Masoud Ghanbari
le 23 Juin 2013
Masoud Ghanbari
le 23 Juin 2013
Modifié(e) : Masoud Ghanbari
le 24 Juin 2013
Catégories
En savoir plus sur Text Data Preparation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!