dividing of binary numbers
Show older comments
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 Comments
Walter Roberson
on 22 May 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
on 22 May 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
on 23 May 2023
Walter Roberson
on 23 May 2023
What do you want to have happen if the character vector is not an exact multiple of 4 long?
Accepted Answer
More Answers (0)
Categories
Find more on Computer Vision with Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!