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?

 Accepted Answer

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:

More Answers (0)

Categories

Products

Release

R2019a

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!