dec2gc.m

This function converts a decimal number to its equivalent gray code representation
다운로드 수: 4.1K
업데이트 날짜: 2005/7/22

라이선스 없음

The function dec2gc converts a real positive numeric column vector to its gray code equivalent with a specified level of precision.

Example:
real_num = [34;78;123;7];%set of real numbers to be converted
N = 7;%precision level for gray coding
gray_code = dec2gc(real_num,N);

Result:
gray_code =

0 1 1 0 0 1 1
1 1 0 1 0 0 1
1 0 0 0 1 1 0
0 0 0 0 1 0 0

NOTE: N should be carefully chosen such that 2^N > max(dec)

인용 양식

Arjun Srinivasan Rangamani (2024). dec2gc.m (https://www.mathworks.com/matlabcentral/fileexchange/8051-dec2gc-m), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R13SP1
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Numeric Types에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0

Corrected for minor adujustments