Bit-slicing function for integer matrices

버전 1.3.0.0 (1.91 KB) 작성자: Damon Bradley
function E = bitreslice(A,b_old, b_new, echo_on) Re-packages bits of a matrix of integers.
다운로드 수: 265
업데이트 날짜: 2011/12/12

라이선스 보기

function E = bitreslice(A,b_old, b_new, echo_on)

Author: Damon Bradley

Purpose: A is an [M by N] matrix of integers. Implicit is each element's
representaiton in binary, which is b_old bits wide. Matrix E is output
which is an [M by L] matrix of integers, with the bits of A concatenated
column-wise and re-split into b_new bit-wide elements. The number of bits
per row, b_old*N must be evenly divisible by b_new to work.

Inputs:
A - An M by N matrix of unsigned integers
b_old - Number of bits to represent A, should be based on maximum value
b_new - New number of bits to slice each bit-concatenated row of A
echo_on - Choose 1 to display underlying bit representation. Don't specify otherwise

Outputs:
E - A new matrix, same number of rows as A, but whose elements
a new set of integers based on the concatenation of ALL bits
for every row, repackaged as elements "b_new" bits wide.
Usage Example:
Re arrange the 4-bit elements of matrix A into a new matrix with 3-bit
elements. The product of the number of columns of A and how many bits
each element is originally represented with must be evenly divisible by
b_new, the new number of bits the output matrix elements are represented
with.

A =

1 4 7
2 3 5
3 3 0

B =

'0001' '0100' '0111'
'0010' '0011' '0101'
'0011' '0011' '0000'

C =

000101000111
001000110101
001100110000

D =

'000' '101' '000' '111'
'001' '000' '110' '101'
'001' '100' '110' '000'

E =

0 5 0 7
1 0 6 5
1 4 6 0

인용 양식

Damon Bradley (2026). Bit-slicing function for integer matrices (https://kr.mathworks.com/matlabcentral/fileexchange/34173-bit-slicing-function-for-integer-matrices), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2009a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Signal Operations에 대해 자세히 알아보기
버전 게시됨 릴리스 정보
1.3.0.0

Fixed another comment

1.1.0.0

Just fixed a comment typo.

1.0.0.0