how to convert logical variable into hexadecimal number in Matlab?
Show older comments
how to convert logical variable into hexadecimal number in Matlab?
2 Comments
James Tursa
on 17 Mar 2021
Please provide a short example of a logical input and what you want for a hex output.
Adam Danz
on 18 Mar 2021
The task seems odd to me, too. hex representation of 1/0 booleans is just '1','0'.
Answers (1)
hexstr = dec2hex([false true true false])
Or perhaps you want,
hexstr = string(double(([false true true false])))
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!