Can I use unary coding to convert a vector of decimals into a binary matrix?
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to convert a decimal vector into a matrix of binary numbers using unary coding. For example:
1 -> 1 0 0 0
2 -> 0 1 0 0
3 -> 0 0 1 0
4 -> 0 0 0 1
I'd like to do this using vector arithmetic, not looping over all of the rows.
1 commentaire
Walter Roberson
le 18 Mar 2013
There are multiple competing stands for unary coding. Which one are you following? How are you representing 0? How are you representing negative numbers? Do you need to represent fractions?
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Multirate Signal Processing 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!