### MATLAB >> How to rearrange a matrix upsidedown?

Hello everyone,

I have a matrix made of 100 rows and 200 columns.
I want to reformat the matrix so that:

1-The 1st row which is on top of the matrix becomes the last row of
the matrix
2-The 100th row which is at the bottom of the matrix becomes the 1st
row of the matrix

In the sense that:
Old Matrix New Matrix

row 1 row 100
row 2 row 99
row 3 row 98
row ... ...
row 50 row 50
row ... ...
row 98 row 3
row 99 row 2
row 100 row 1

Could someone help me?

Thank you
Nuage

help flipud

ross

### MATLAB >> How to rearrange a matrix upsidedown?

Hi Ross

Thank you very much for your help ;-).

Nuage

### MATLAB >> How to rearrange a matrix upsidedown?

XXXX@XXXXX.COM (Nuage) wrote in

You can use vector-indexing

new = old(end:-1:1,:) ;

or take a look at the (slower) FLIPUD function.

Jos

--
Email: jnvdg AT arcor DOT de

### MATLAB >> How to rearrange a matrix upsidedown?

Hello Jos

How are you?
Thank you for your help.

What does the command means?
new file equal old final, start at the end(last row) and end at row 1,
with increment of minus 1 for all columns of that row at the same time
...?

Thank you
Nuage

### MATLAB >> How to rearrange a matrix upsidedown?

XXXX@XXXXX.COM (Nuage) wrote in

Hi Nuage,
you are right. I think it will help you a great deal to read some stuff on
matrix indexing in matlab (see for instance the help files).

Jos

--
Email: jnvdg AT arcor DOT de

```Hi This is probably very easy so please bear with me. I
have a matrix M(b,c,a) but I need it to be rearranged as
M(a,b,c).

Thanks,
S
```

```thank :)
```

```Hi,

Supposing I have a matrix

a b c d e
f g h i j
k l m n o
p q r s t

I want to turn that into a matrix that's like

a b c d e f g h i j k l m n o p q r s t

so that i can plot it on a graph in a certain way.

I was wondering what the best way of doing this is... should I write
a for loop?

All the best,

Tom
```

```In tomographic reconstruction, after applying 1-D orthonormal
multiscale wavelet transform to angle-ordered projection data, we get
multiscale representation of the data, which is also angle-ordered.
My question is how to arrange it by scales? That means all the finest
scale components of each angle are groups first, then the second
finest scale components, ...
```