How to specifiy the data format to export generated data from matlab?!

4 ビュー (過去 30 日間)
John
John 2015 年 10 月 9 日
コメント済み: Walter Roberson 2015 年 10 月 12 日
Hi Guys,
I try to save data to a text format. The name of the data exported is:
name=[Model_File '__ Timeslot_STI: ' num2str(Timeslot)]
fid = fopen(name,'w'); % Create/open file discarding content
now i dont know how to specify the file type, when i creat this document. I would like to save it as txt.file... Does anyone know how to arrange this?
I am very glad for your help! Best regards, John

採用された回答

Walter Roberson
Walter Roberson 2015 年 10 月 9 日
name = sprintf('%s__ Timeslot_STI: %g.txt', Model_File, Timeslot);
fid = fopen(name, 'wt'); % Create/open file discarding content
  5 件のコメント
John
John 2015 年 10 月 12 日
Hi Walter,
ext='.txt'; %extension in which files will be saved
filename=['text_dyn',ext];
% Create/open file discarding content
fid = fopen(filename,'wt');
works fine with me and creates a textfile:)
Walter Roberson
Walter Roberson 2015 年 10 月 12 日
Colons (':') are not permitted in MS Windows file names as they are reserved for drive specifications.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLow-Level File I/O についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by