Check for hexadecimal number

27 ビュー (過去 30 日間)
Harshita K
Harshita K 2020 年 9 月 22 日
回答済み: Walter Roberson 2020 年 9 月 22 日
Hello,
I have a data which has a hexadecimal number : 0x5200 (or any hexa decimal value)
How do I check if the number is of the size 4 after '0x' and also qualifies to be a hexadecimal number in the range 0x5A00 to 0x5FFF?

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 9 月 22 日
regexpi(S, '^0X5[A-F][0-9A-F]{2}$')
if the result is empty there is no exact match (but it might be a hex number in a different range, or it might be non-hex, or it might be missing the 0x)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by