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 Comments
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/365034-print-leading-and-trailing-zeros-into-text-file#comment_500890
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/365034-print-leading-and-trailing-zeros-into-text-file#comment_500890
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/365034-print-leading-and-trailing-zeros-into-text-file#comment_500892
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/365034-print-leading-and-trailing-zeros-into-text-file#comment_500892
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/365034-print-leading-and-trailing-zeros-into-text-file#comment_500899
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/365034-print-leading-and-trailing-zeros-into-text-file#comment_500899
Sign in to comment.