Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Reverse oreder of an array

Subject: Reverse oreder of an array

From: Abdullah

Date: 6 Jan, 2010 15:28:04

Message: 1 of 5

Hi all,

I got a problem with reversing order of an array.
I have a column vector of 100 elements. I want to reverse the order of this array and store it in another array.
i.e 100th element becomes 1st.
99th , 2nd
98th, 3rd and so on till the 1st element is the 100th in the new array.
Please help.

Subject: Reverse oreder of an array

From: Matt J

Date: 6 Jan, 2010 15:33:05

Message: 2 of 5

"Abdullah " <abdullahumer@yahoo.com> wrote in message <hi2a64$1t9$1@fred.mathworks.com>...
> Hi all,
>
> I got a problem with reversing order of an array.
> I have a column vector of 100 elements. I want to reverse the order of this array and store it in another array.
> i.e 100th element becomes 1st.
> 99th , 2nd
> 98th, 3rd and so on till the 1st element is the 100th in the new array.
> Please help.

newArray=Array(end:-1:1);

Subject: Reverse oreder of an array

From: Matt J

Date: 6 Jan, 2010 15:34:04

Message: 3 of 5



newArray=flipud(Array);

Subject: Reverse oreder of an array

From: us

Date: 6 Jan, 2010 17:36:02

Message: 4 of 5

"Abdullah " <abdullahumer@yahoo.com> wrote in message <hi2a64$1t9$1@fred.mathworks.com>...
> Hi all,
>
> I got a problem with reversing order of an array.
> I have a column vector of 100 elements. I want to reverse the order of this array and store it in another array.
> i.e 100th element becomes 1st.
> 99th , 2nd
> 98th, 3rd and so on till the 1st element is the 100th in the new array.
> Please help.

and - yet another one

     help flipdim;

us

Subject: Reverse oreder of an array

From: Abdullah

Date: 6 Jan, 2010 18:00:22

Message: 5 of 5

"us " <us@neurol.unizh.ch> wrote in message <hi2hm2$bcr$1@fred.mathworks.com>...
> "Abdullah " <abdullahumer@yahoo.com> wrote in message <hi2a64$1t9$1@fred.mathworks.com>...
> > Hi all,
> >
> > I got a problem with reversing order of an array.
> > I have a column vector of 100 elements. I want to reverse the order of this array and store it in another array.
> > i.e 100th element becomes 1st.
> > 99th , 2nd
> > 98th, 3rd and so on till the 1st element is the 100th in the new array.
> > Please help.
>
> and - yet another one
>
> help flipdim;
>
> us

Thanks! It worked.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us