Generate matrix of bits

后端 未结 3 501
别跟我提以往
别跟我提以往 2021-01-21 04:52

I would like to take an integer n defining the number of bits in my communication code and a vector defining the alphabet I am assigning to bits 0:n-1,

3条回答
  •  春和景丽
    2021-01-21 04:59

    To easily convert zeros to -1 (and leave the ones intact) you can simply do

    minusOnes = 2 * zeroOnes - 1;
    

提交回复
热议问题