how to convert logical variable into hexadecimal number in Matlab?

how to convert logical variable into hexadecimal number in Matlab?

2 Kommentare

Please provide a short example of a logical input and what you want for a hex output.
The task seems odd to me, too. hex representation of 1/0 booleans is just '1','0'.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Adam Danz
Adam Danz am 17 Mär. 2021
Bearbeitet: Adam Danz am 17 Mär. 2021
hexstr = dec2hex([false true true false])
hexstr = 4×1 char array
'0' '1' '1' '0'
Or perhaps you want,
hexstr = string(double(([false true true false])))
hexstr = 1×4 string array
"0" "1" "1" "0"

Kategorien

Gefragt:

am 17 Mär. 2021

Kommentiert:

am 18 Mär. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by