Hi all, I have the following function that takes x which is a unit32 vector of about 2 billion elements. Basically it expands the decimal numbers and then classify each element based on the structure of the binary string:
function class = classX( x )class=uint32(zeros(size(x)));parfor i=1:length(x) binary=de2bi(x(i),32); if binary(1)==0 && binary(2)==0 class(i)=1; elseif binary(1)==0 && binary(2)==1 class(i)=2; endend
I'm looking for a possible way to speed this function as much as possible. I look forward to your creative ideas.
AD
Best Answer