필터 지우기
필터 지우기

Transform a vector by keeping the numbers by pairs

조회 수: 1 (최근 30일)
Sabato De Gregorio
Sabato De Gregorio 2018년 5월 18일
댓글: Sabato De Gregorio 2018년 5월 18일
Let's say I have a vector that contains some coordinates (x,y) in this way:
A=[1 2 3 4 5 6 7 8 9 10]
And I want to transform it in this matrix:
A = [1 2
3 4
5 6
7 8
9 10]
How can I do it? 'reshape' command is not what I'm searching. Thanks for the help.

채택된 답변

Walter Roberson
Walter Roberson 2018년 5월 18일
reshape(A, 2, []).'

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by