
Re: Swaping rows of a matrix
Posted:
Feb 6, 2013 1:16 PM


"Nasser M. Abbasi" wrote in message <keu59d$ck$1@speranza.aioe.org>... > On 2/6/2013 11:49 AM, Boosan wrote: > > How can i swap rows of a matrix? > > > > may be > > tmp = A(2,:) > A(2,:) = A(3,:) > A(3,:) = tmp
This trick of using temporary variable is good for C, fortran. In MATLAB simply do
A([2 3],:) = A([3 2],:);
for swapping.
Bruno

