print leading and trailing zeros into text file
조회 수: 4 (최근 30일)
이전 댓글 표시
hi I have this hex values 0BA12CE0 that I want to print to a text file ,uses these commands to do that :
fileID1 = fopen('enct40.txt','wt');
fprintf(fileID1,'%s\n',cd1);
fclosef(fileID1);
but when I open the text file the leading and trailing zeros are disappear like this 'BA12CE' how can I print the results as they are without any missing values ?
댓글 수: 3
per isakson
2017년 11월 4일
편집: per isakson
2017년 11월 4일
This works here on R2016a,Win7
cd1 = '0BA12CE0';
fileID1 = fopen('enct40.txt','wt');
fprintf(fileID1,'%s\n',cd1);
fclose(fileID1);
type enct40.txt
output
0BA12CE0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!