dividing of binary numbers
Afficher commentaires plus anciens
See i have a binary code of unknown length , i want to divide it into blocks of length four and assign each block to a variable .
4 commentaires
Walter Roberson
le 22 Mai 2023
How is your "binary code of unknown length" stored?
Is it stored like
'0001101000111'
is it stored like
[0 0 0 1 1 0 1 0 0 0 1 1 1]
is it stored like
[false false false true true false true faslse false false true true true]
is it encoded into a single uint64 number (and so has a maximum length of 64) ?
Walter Roberson
le 22 Mai 2023
and assign each block to a variable
Please read http://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not-be-named-dynamically-eval for information about why we strongly recommend against creating variable names dynamically.
Ganesh
le 23 Mai 2023
Walter Roberson
le 23 Mai 2023
What do you want to have happen if the character vector is not an exact multiple of 4 long?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Computer Vision with Simulink dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!