From: Peter Smith on
Hi all
Does neone know a way to swap columns in matrix, for example suppost i have a 10*10 matrix, and i want to swap the 1st and the 3rd columns and then the 5th and the 7th columns?
Many thanks for your help
From: James Tursa on
"Peter Smith" <fe09ae(a)mail.wbs.ac.uk> wrote in message <i3aued$ijv$1(a)fred.mathworks.com>...
> Hi all
> Does neone know a way to swap columns in matrix, for example suppost i have a 10*10 matrix, and i want to swap the 1st and the 3rd columns and then the 5th and the 7th columns?
> Many thanks for your help

A(:,[1 3]) = A(:,[3 1]);

James Tursa
From: Peter Smith on
thanks alot james, your reply is excellent
cheers