How can I convert zero number to modified hexadecimal in formatting strings?
Show older comments
IN THE NAME OF GOD
Hi.
>> sprintf('%#.2X', 0)
ans =
00
but I want a modified hexadecimal such as following:
ans =
0X00
Note: This works correctly for positive integers. See bellow:
>> sprintf('%#.2X', 1)
ans =
0X01
Thanks.
Mosakazemi
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!