dlmwrite 0 to 0.0
조회 수: 2 (최근 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!