From: Jez S on
a=[1 2 3 4 5]

is there a way to swap an element in the list without storing. Is there a
command or a one line command that can. Currently I am implementing

b=2, c=4
a(2)=c; a(4)=b

I do not want to use that so is there any other way to make the swapping
procedure efficent or in a one line command way.

Thanks in advance

p.s trying to cut down my code as much as possible


--- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Walter Roberson on
Jez S wrote:
> a=[1 2 3 4 5]
>
> is there a way to swap an element in the list without storing.

a([2 4]) = a([4 2]);