comparison general/numerical/array/binary.m @ 16:db7f4afd27c5

Rearranging numerical toolbox.
author samer
date Thu, 17 Jan 2013 13:20:44 +0000
parents general/numerical/binary.m@e44f49929e56
children
comparison
equal deleted inserted replaced
15:19ec801ee487 16:db7f4afd27c5
1 % binary - return array contain binary sequece over N columns
2 %
3 % binary :: N:natural -> [[2^N,N]->{0,1}].
4 %
5 % note: returns an array of uint32
6
7 function B=binary(N)
8
9 M=2^N;
10 B=zeros(M,N,'uint8');
11 b=1:N;
12 for i=1:M
13 B(i,:)=bitget(uint32(i-1),b);
14 end