From: roya olyazadeh on
I have this matrix :

Qx= 1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

I want to put it in matrix format like this :

V= 1
2
3
4
.
.
.
14
15


what is the solution ?

From: A on
On May 30, 1:39 pm, "roya olyazadeh" <roya2...(a)gmail.com> wrote:
> I have this matrix :
>
> Qx= 1
>        2    3
>        4    5    6
>        7    8    9   10
>        11  12  13  14  15
>
> I want to put it in matrix format like this :
>
> V=  1
>       2
>       3
>       4
>       .
>       .
>       .
>      14
>      15
>
> what is the solution ?

V = Qx.'; % transpose
V = V(V~=0);
From: Bruno Luong on
A <aragorn168b(a)gmail.com> wrote in message <1e5cd43b-8fea-4b5e-995f-26d4efa4d5a3(a)p5g2000pri.googlegroups.com>...

>
> V = Qx.'; % transpose
> V = V(V~=0);

Don't! If there is a 0 somewhere in the lower part of Qx, the above will give unexpected result.

A better way is

V = Qx.';
V = V(triu(true(size(V))))

Bruno