How to convert decimal value to a binary string, and then convert them to a vector?

I want to convert decimal value to a binary string, but I am not able to convert the binary string to vector.
How can I do it?

 Réponse acceptée

MATLAB function "decimalToBinaryVector" will help you to convert decimal to binary. Please run the below command in the command window of installed MATLAB R2019a version to get release specific documentation on "decimalToBinaryVector" function:
>> web(fullfile(docroot, 'daq/ref/decimaltobinaryvector.html'))
This function will only help, if you have Data Acquisition Toolbox.
If you do not have this toolbox, you can convert your binary string to vector by following the below steps:
>> strTemp = '11010'
>> ans = num2str(strTemp)-'0';
Please follow the below link to search for the required information regarding the current release:

Plus de réponses (0)

Catégories

Produits

Version

R2019a

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by