📄 mbin_state.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Property of Freescale
% Freescale Confidential Proprietary
% Freescale Copyright (C) 2005 All rights reserved
% ----------------------------------------------------------------------------
% $RCSfile: mBin_state.m.rca $
% $Revision: 1.1 $
% $Date: Mon Jan 22 10:28:18 2007 $
% Target: Matlab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Decrease length of computation (use of the library function dec2bin)
%
% bin_state = mBin_state( int_state, m ) converts an vector
% of integer into a binary matrix; the i-th row is the binary
% form of m bits for the i-th integer;
% For example, bin_state (3,2)-->1 1
%
% Output:
% bin_state => the converted matrix
% Inputs:
% int_state => the vector of integer need to be converted
% m => the binary representation with at least m bits.
function bin_state = mBin_state( int_state, m )
bin_state = rem(floor(int_state.*pow2(1-m:0)),2);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -