How to swap columns of a matrix??

53 vues (au cours des 30 derniers jours)
Ali nouri
Ali nouri le 24 Mar 2020
Réponse apportée : Sayali le 6 Juin 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.

Réponse acceptée

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

Plus de réponses (1)

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

Catégories

En savoir plus sur Satellite and Orbital Mechanics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by