how reverse the array sequence

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how reverse the array sequence

turbofib
hi,

Example:

a=[1 3 4 5 5 6 7 8]

i want this:


a=[8 7 6 5 4 3 2 1]







--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html

Reply | Threaded
Open this post in threaded view
|

Re: how reverse the array sequence

Doug Stewart-4


On Tue, Jul 17, 2018 at 3:36 PM, turbofib <[hidden email]> wrote:
hi,

Example:

a=[1 3 4 5 5 6 7 8]

i want this:


a=[8 7 6 5 4 3 2 1]







--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html



try 
flip



--
DASCertificate for 206392

Reply | Threaded
Open this post in threaded view
|

Re: how reverse the array sequence

nrjank
In reply to this post by turbofib

a=[1 3 4 5 5 6 7 8]

i want this:


a=[8 7 6 5 4 3 2 1]




>> a = 1:5
a =

   1   2   3   4   5

>> a(end:-1:1)
ans =

   5   4   3   2   1



Reply | Threaded
Open this post in threaded view
|

Re: how reverse the array sequence

Daniel Sebald
In reply to this post by turbofib
On 07/17/2018 02:36 PM, turbofib wrote:

> hi,
>
> Example:
>
> a=[1 3 4 5 5 6 7 8]
>
> i want this:
>
>
> a=[8 7 6 5 4 3 2 1]
>

This is discussion list, not a help list.  The GUI version of Octave
comes with a searchable documentation file.  Give that a try.

Dan