フィルターのクリア

How do I format a .txt file I've created?

1 回表示 (過去 30 日間)
Christopher Maraj
Christopher Maraj 2018 年 3 月 18 日
編集済み: Stephen23 2018 年 3 月 18 日
Im trying to display max_speed for 6 different satellites in a .txt file, however when i run this code only sat_id appears, not max_speed. Can someone help me fix this?
fileID=fopen('report.txt','w');
fprintf(fileID,'name\n');
fprintf(fileID,'studentnumber\n');
fprintf(fileID,'sat_id,max_speed(m/s),min_speed(m/s),orbital_period_before(s),orbital_period_after(s)\n');
for n = 1:6
fprintf(fileID,'%d\n', stat(n).sat_id);fprintf(fileID,'%15:9e %15:9e\n', stat(n).max_speed);
end fclose(fileID);
end

採用された回答

Stephen23
Stephen23 2018 年 3 月 18 日
編集済み: Stephen23 2018 年 3 月 18 日
%15:9e
is not a valid format string. Perhaps you meant to write a decimal point:
%15.9e

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Data Preparation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by