I have 2-D matrix having both positive and negative decimal integer I want to convert all elements of matrix to binary numbers. How can I do this?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have 2-D matrix having both positive and negative decimal numbers I want to convert all elements of matrix to binary numbers. How can I do this?
0 commentaires
Réponses (1)
Image Analyst
le 28 Jan 2017
Try this:
binaryMatrix = yourMatrix > someThreshold; % such as yourMatrix > 0 or whatever number you want.
That's a binary matrix with 0's and 1's, actually false's and true's. If you want a binary like strings, use dec2bin().
1 commentaire
Voir également
Catégories
En savoir plus sur Data Type Conversion dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!