필터 지우기
필터 지우기

dlmwrite 0 to 0.0

조회 수: 2 (최근 30일)
Anna Cole
Anna Cole 2018년 6월 4일
댓글: Walter Roberson 2018년 6월 4일
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.

채택된 답변

Walter Roberson
Walter Roberson 2018년 6월 4일
Use 'precision', '%.1f' for dlmwrite()
  댓글 수: 2
Anna Cole
Anna Cole 2018년 6월 4일
Can I have a different precision for different columns in dlmwrite?
Walter Roberson
Walter Roberson 2018년 6월 4일
Sorry, that is not possible with dlmwrite(). You should fopen/fprintf/fclose for that.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by