Dynamic-Calibration/utils/YALMIP-master/extras/dec2decbin.m

6 lines
196 B
Mathematica
Raw Permalink Normal View History

2019-12-18 11:25:45 +00:00
function s=dec2decbin(d,n)
%DEC2BIN Internal function generate binary matrices
[f,e]=log2(max(d)); % How many digits do we need to represent the numbers?
s=rem(floor(d(:)*pow2(1-max(n,e):0)),2);