From: Jez S on 6 Feb 2010 16:04 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 6 Feb 2010 16:47 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]);
|
Pages: 1 Prev: Neural Network Training algorithms Next: Trying to create a 'do it all' plotting script |