How to swap columns of a matrix??

81 次查看(过去 30 天)
I have a matrix of 8760X30, the first 7 columns need to be swap with some other column. eg. the first and the second columns need to need to be swap with the 8 and 9 column.

采纳的回答

Birdman
Birdman 2020-3-24
Simple approach(Consider matrix A):
A(:,[1 2 8 9])=A(:,[8 9 1 2])

更多回答(1 个)

Sayali
Sayali 2023-6-6
a=[ 1 2 3; 2 4 5]

类别

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