Effacer les filtres
Effacer les filtres

how to export the values from matrix into txt file?

2 vues (au cours des 30 derniers jours)
Muhammad RSMY
Muhammad RSMY le 3 Jan 2018
hi friends
I have matrix suppose
[100 10]=size(matrix)
I want export the values of matrix in table format in txt
for example the output should look like
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
:
:
thanks for your kind support

Réponse acceptée

KSSV
KSSV le 3 Jan 2018
A = rand(7) ;
fid = fopen('data.txt','w') ;
fprintf(fid,[repmat('%f\t', 1, size(A, 2)) '\n'], A');
fclose(fid) ;
Also read about dlmwrite, save.
  1 commentaire
Muhammad RSMY
Muhammad RSMY le 3 Jan 2018
Modifié(e) : Muhammad RSMY le 3 Jan 2018
Thanks for your kind response,,
but in txt its not giving the same dimension
I need the dimension of table should be 100*10
*NOTED* Ok I will ready about dimension.. thanks
thanks once again

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Tables dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by