num to uint8 output, How to as=num, uint8 output
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
dmfwlansejr
am 15 Jul. 2021
Beantwortet: Steven Lord
am 15 Jul. 2021
>> 0x10
ans =
uint8
16
>> as=10;
>> 0xas <-This is an Error
How too make output uint8 16
Variable 'as' must be used!
1 Kommentar
Akzeptierte Antwort
Steven Lord
am 15 Jul. 2021
as = 10;
y = uint8(hex2dec(string(as)))
That 0x followed by hex digits syntax is for defining literals, much like you'd type:
q = 1e4
r = 3+4i
It cannot be used with variables.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!