How to convert a string into row vector?
4 views (last 30 days)
More Answers (2)
Image Analyst on 11 Mar 2022
Please note that the other answers will not include the leading zero if there is one.
You didn't specify if you want leading zero(s) if there are any. You can specify the number of bits in dec2bin if you want. For example this (dec2bin(a, 8)) is what you might do
a = 103;
b = dec2bin(a)-'0' % Does not include leading zeros for an 8 bit number
c = dec2bin(a, 8)-'0' % Does include leading zeros for an 8 bit number
Did you want leading zeros or not?