?? deci22bin.m
字號(hào):
%deci22bin.m
function y=deci22bin(x,t)
%十進(jìn)制數(shù)x轉(zhuǎn)化為二進(jìn)制數(shù),二進(jìn)制數(shù)至少表示為t位
y=zeros(size(x,1),t);
for j=1:size(x,1)
i=1;
while x(j)>=0&i<=t
y(j,i)=rem(x(j),2);
x(j)=(x(j)-y(j,i))/2;
i=i+1;
end
y(j,:)=y(j,t:-1:1);
end
%************************end of file***********************************
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -