dlmwrite 0 to 0.0
3 次查看(过去 30 天)
显示 更早的评论
I am using dlmwrite to create two columns in a text file. The first column contains numbers (a=[1:1:100]) and then second column contains zeros (b=zeros(100,1). I then concatenated them and replaced some of the zeros with numbers. When written to a file I need the zeros to display as 0.0 instead of 0. I currently have it written to a .txt file.
0 个评论
采纳的回答
Walter Roberson
2018-6-4
Use 'precision', '%.1f' for dlmwrite()
2 个评论
Walter Roberson
2018-6-4
Sorry, that is not possible with dlmwrite(). You should fopen/fprintf/fclose for that.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!