MATLAB: Dlmwrite 0 to 0.0

dlmwriteMATLAB

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.

Best Answer

Use 'precision', '%.1f' for dlmwrite()
Related Question