I HAVE A KEY WHICH IS 1*16 MATRIX. HOW CAN I DETERMINE IT'S BIT SIZE?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
KEY=[0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0]
0 commentaires
Réponse acceptée
KSSV
le 16 Août 2022
KEY=[0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0] ;
a = single(KEY) ;
iwant = whos('a')
3 commentaires
Plus de réponses (2)
Abderrahim. B
le 16 Août 2022
Modifié(e) : Abderrahim. B
le 16 Août 2022
Hi!
Try this:
KEY = [0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0] ;
KEY = single(KEY) ;
% WHOS returns a structure
S = whos("KEY") ;
S.class
% Bit is an eighth of a byte
bitSize = S.bytes * 8
Hope this helps
Walter Roberson
le 16 Août 2022
KEY=[0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0]
bits_required_per_entry = max( ceil(log2(KEY)) )
However the calculation changes if any entry might be negative.
1 commentaire
Voir également
Catégories
En savoir plus sur Encryption / Cryptography dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!