How to write vectors line by line in a txt file using fprintf delimited by a space?
    3 ビュー (過去 30 日間)
  
       古いコメントを表示
    
I have for example these three vectors : [1 2 3 ], [4 5 6 ],[7 8 9]. I would like to get the result like this in the file txt:
1 2 3 4 5 6 7 8 9
(each vector in a line) I tryed this
fid= fopen('h.txt','w');
fprintf(fid,'%.5f',h0);
fclose(fid)
but i didn't get the result. Delimiter ' ' doesn't work with this command.
0 件のコメント
採用された回答
  Adam
      
      
 2015 年 8 月 6 日
        fprintf(fid,'%.5f ',h0);
should be enough. Note the space in the string.
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Entering Commands についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


