print leading and trailing zeros into text file

10 views (last 30 days)
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');
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 ?
mia saam
mia saam on 4 Nov 2017
It's dec value=195112160 when I use dec2hex(195112160) the leading zero will disappear

Sign in to comment.

Accepted Answer

Cedric Wannaz
Cedric Wannaz on 4 Nov 2017
>> dec2hex(195112160, 8)
ans =

More Answers (0)


Community Treasure Hunt

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

Start Hunting!