import data into a txt file from matlab

2 Ansichten (letzte 30 Tage)
Tinkul
Tinkul am 13 Sep. 2012
I want to import data into txt file. I have written the prog.
m=[1 2 3 4 5 6 6 6 7 8 9] fid = fopen('data.txt', 'w'); % data.txt is the txt file where i have to import fprintf(fid, '%d', m); fclose(fid);
But the result shows none....Please help

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 13 Sep. 2012
Bearbeitet: Azzi Abdelmalek am 13 Sep. 2012
you mean export data to text file
m=[1 2 3 4 5 6 6 6 7 8 9]
fid = fopen('data.txt', 'w');
fprintf(fid, '%d', m);
fclose(fid);
works fine
or
dlmwrite('file.txt',m,'delimiter',' ')

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by