使用系列将双数组转换为二进制数

时间:2016-09-11 07:14:13

标签: matlab

我有一个系列[ 7 5 4 3 2 1]。我想通过考虑上述数字的位置值将数字转换为二进制序列。所以每个数字都有很多组合,如..

3 is represented as [ 0 0 0 1 0 0 ] again 3 is represented as [ 0 0 0 0 1 1]
4 is represented as [ 0 0 1 0 0 0 ] again 4 is represented as [ 0 0 0 1 0 1] 
5 is represented as [ 0 1 0 0 0 0 ] again 5 is represented as [ 0 0 0 1 1 0] 
5 is represented as [ 0   0    1   0   0    1]   

我想将所有值存储在数组中。任何人都可以帮我编写Matlab代码吗?

0 个答案:

没有答案