bin2pol.m
上传用户:m_sun_001
上传日期:2014-07-30
资源大小:1115k
文件大小:0k
- function y = bin2pol(x)
- % bin2pol
- %
- % Converts binary numbers (0,1) to polar numbers (-1,1)
- % Accepts a 1-D array of binary numbers
- y = ones(1,length(x));
- for i = 1:length(x)
- if x(i) == 0
- y(i) = -1;
- end
- end