- function y = pol2bin(x)
- % pol2bin
- %
- % Converts polar numbers (-1,1) to binary numbers (0,1)
- % Accepts a 1-D array of polar numbers
- % Removes trailing zeros, since they are not valid data
- % % Remove zeros - not needed with intelligent decoding
- % last_data=length(x);
- % while x(last_data) == 0
- % last_data = last_data - 1;
- % end
- y = ones(1,length(x));
- for i = 1:length(x)
- if x(i) == -1
- y(i) = 0;
- end
- end