MATLAB: Problem using num2str and bin2dec in size

.binaryconversiondecimalMATLABnumberslow

having an array of 32*32 when using num2str i get a char array of 32*94 why? i cannot use bin2dec on it
data = uint32(randi(2^31,[32,1]));
m = de2bi((data),32);
groups = num2str(m');
the array groups will be of type char 32*94 i cannot convert it to decimal :S
- - - Updated - - -
tic
data = uint32(randi(2^31,[32,1]));
m = de2bi((data),32);
groups = (m');
power2=[1,32];
for i=1:32
power2(i)=2^(i-1);
end
power2=uint32(power2);
decnum=[1,32];
for i=1:32
decnum(i)=(sum(power2.*groups(i,:)));
end
decnum=uint32(decnum);
toc
this is the updated code but it is somekind of slow if i want to do it on 500 000number any suggestions plz?

Best Answer

Hi
groups(:,1:3:end) %makeing result 32*32 again
Try this(Your updated code):
data = uint32(randi(2^31,[32,1]));
m = de2bi((data),32);
groups = num2str(m');
a=groups(:,end:-3:1);
b=bin2dec(a);
c=uint32(b);