필터 지우기
필터 지우기

[1 0 1 1 0 1 1 0] to [10 11 01 10]?

조회 수: 1 (최근 30일)
Emanuel
Emanuel 2019년 6월 1일
댓글: James Tursa 2019년 6월 2일
I need to transform 8 numbers into 4 like the title, how could i do that?
  댓글 수: 3
James Tursa
James Tursa 2019년 6월 1일
"Numeric formats do not store leading digits"
I know what you meant by this (floating point formats), but in fact all of the integer formats store leading digits. For these formats it is more of a display issue rather than a storage issue.
James Tursa
James Tursa 2019년 6월 2일
@Stephen: I was responding to your blanket statement ... not to OP directly. E.g., the leading bits of 2's complement integers are physically stored, regardless of whether the MATLAB doc talks at this level or not.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2019년 6월 1일
V = [1 0 1 1 0 1 1 0];
one_way = V(1:2:end) * 10 + V(2:2:end)
another_way = reshape(V, 2, []).'

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by