How to swap columns of a matrix??

53 Ansichten (letzte 30 Tage)
Ali nouri
Ali nouri am 24 Mär. 2020
Beantwortet: Sayali am 6 Jun. 2023
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.

Akzeptierte Antwort

Birdman
Birdman am 24 Mär. 2020
Simple approach(Consider matrix A):
A(:,[1 2 8 9])=A(:,[8 9 1 2])

Weitere Antworten (1)

Sayali
Sayali am 6 Jun. 2023
a=[ 1 2 3; 2 4 5]

Kategorien

Mehr zu Satellite and Orbital Mechanics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by