Transform a vector by keeping the numbers by pairs

1 次查看(过去 30 天)
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