function X = vaneck2bin(data, thold) i=1; tmp = size(data); MySize = tmp(1); %size of the entire sample while( i < MySize ) %loop for each sample until the end if(data(i) > thold) j(i,1) = 1; else j(i,1) = 0; end i = i + 1; end X = j;