Convert Decimal to Binary Vector

前端 未结 4 814
暗喜
暗喜 2021-01-05 01:13

I need to convert a Decimal Number to a Binary Vector

For example, Something like this:

  length=de2bi(length_field,16);

Unfortunat

4条回答
  •  既然无缘
    2021-01-05 02:04

    A single call to Matlab's built-in function dec2bin can achieve this:

    binVec = dec2bin(data, nBits)-'0'
    

提交回复
热议问题