Generate possible sequences of m^n elements. Each sequence containing 10 bits.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Md. Sakib-Ul-Islam
am 19 Dez. 2021
Bearbeitet: Md. Sakib-Ul-Islam
am 19 Dez. 2021
I am trying to generate a set of binary sequence.
The entire set of possible sequences contain 5^10 = 976525 elements. And sequence of each elements must be restricted to having 10bits. A sequence for example: 0011010110.
I tried doing
A = dec2bin(1:5^10)
It gives me the right number of elements, but gives me 21 characters
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 19 Dez. 2021
That cannot be done in a unique way.
In order to represent n elements in n bits, each element can only carry one bit. The value 5 requires more than 2 bits, so 10 of those would take slightly more than 2*10 = 20 bits.
10 bits can only represent 2^10 = 1024 different values, but you have 976525 different values to represent, about 950 times higher.
1 Kommentar
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!