フィルターのクリア

import data into a txt file from matlab

1 回表示 (過去 30 日間)
Tinkul
Tinkul 2012 年 9 月 13 日
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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 9 月 13 日
編集済み: Azzi Abdelmalek 2012 年 9 月 13 日
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',' ')

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by