필터 지우기
필터 지우기

Convert binary to decimat

조회 수: 2 (최근 30일)
Luqman Saleem
Luqman Saleem 2017년 7월 25일
답변: Walter Roberson 2017년 7월 25일
I have matrix A as:
A=
[11
101
110]
11, 101 and 110 here are in decimal system. But I want MATLAB to consider 11 as bits and convert them into decimals. i.e. 11=3, 101=5 and 110=6. Is there any way of doing this on a matrix of any dimension which have elements like this?

채택된 답변

Walter Roberson
Walter Roberson 2017년 7월 25일
bin2dec(num2str(A, '%08d'))
Note: A needs to be a column vector for this to work.

추가 답변 (1개)

James Tursa
James Tursa 2017년 7월 25일

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by