From: Vanesa on
Hi

How could I vertically concatenate the lower diagonals of a matrix including zeroes if there are any?

Thanks
From: Luca Zanotti Fragonara on
"Vanesa " <vanesa2455(a)HOTMAIL.com> wrote in message <hjnbkr$opj$1(a)fred.mathworks.com>...
> Hi
>
> How could I vertically concatenate the lower diagonals of a matrix including zeroes if there are any?
>
> Thanks

I didn't understand very well your questions, but with v = diag(X), you can get the diagonal of a matrix.
From: Vanesa on
"Luca Zanotti Fragonara" <Luca_Zanotti(a)libero.it> wrote in message <hjnc3s$ort$1(a)fred.mathworks.com>...
> "Vanesa " <vanesa2455(a)HOTMAIL.com> wrote in message <hjnbkr$opj$1(a)fred.mathworks.com>...
> > Hi
> >
> > How could I vertically concatenate the lower diagonals of a matrix including zeroes if there are any?
> >
> > Thanks
>
> I didn't understand very well your questions, but with v = diag(X), you can get the diagonal of a matrix.
Hi,
Lets say i have this matrix
fr =

0.3993 0.2920 0.1062 0.9516 0.4228
0.5269 0.4317 0.3724 0.9203 0.5479
0.4168 0.0155 0.1981 0.0527 0.9427
0.6569 0.9841 0.4897 0.7379 0.4177
0.6280 0.1672 0.3395 0.2691 0.9831

how can i get the following result which is the lower triangular matrix on a column vector?
is there a loop i could try?
0.3993
0.4317
0.1981
0.7379
0.9831
0.5269
0.0155
0.4897
0.2691
0.4168
0.9841
0.3395
0.6569
0.1672
0.6280
thanks again
From: Vanesa on
"Luca Zanotti Fragonara" <Luca_Zanotti(a)libero.it> wrote in message <hjnc3s$ort$1(a)fred.mathworks.com>...
> "Vanesa " <vanesa2455(a)HOTMAIL.com> wrote in message <hjnbkr$opj$1(a)fred.mathworks.com>...
> > Hi
> >
> > How could I vertically concatenate the lower diagonals of a matrix including zeroes if there are any?
> >
> > Thanks
>
> I didn't understand very well your questions, but with v = diag(X), you can get the diagonal of a matrix.

lets say i have tthis matrix:

0.3993 0.2920 0.1062 0.9516 0.4228
0.5269 0.4317 0.3724 0.9203 0.5479
0.4168 0.0155 0.1981 0.0527 0.9427
0.6569 0.9841 0.4897 0.7379 0.4177
0.6280 0.1672 0.3395 0.2691 0.9831

how can i get a column vector with the its lower diagonals, like this:

0.3993
0.4317
0.1981
0.7379
0.9831
0.5269
0.0155
0.4897
0.2691
0.4168
0.9841
0.3395
0.6569
0.1672
0.6280

is there any loop for this i could try?

thanks
From: John D'Errico on
"Vanesa " <vanesa2455(a)HOTMAIL.com> wrote in message <hjncso$fna$1(a)fred.mathworks.com>...
> "Luca Zanotti Fragonara" <Luca_Zanotti(a)libero.it> wrote in message <hjnc3s$ort$1(a)fred.mathworks.com>...
> > "Vanesa " <vanesa2455(a)HOTMAIL.com> wrote in message <hjnbkr$opj$1(a)fred.mathworks.com>...
> > > Hi
> > >
> > > How could I vertically concatenate the lower diagonals of a matrix including zeroes if there are any?
> > >
> > > Thanks
> >
> > I didn't understand very well your questions, but with v = diag(X), you can get the diagonal of a matrix.
> Hi,
> Lets say i have this matrix
> fr =
>
> 0.3993 0.2920 0.1062 0.9516 0.4228
> 0.5269 0.4317 0.3724 0.9203 0.5479
> 0.4168 0.0155 0.1981 0.0527 0.9427
> 0.6569 0.9841 0.4897 0.7379 0.4177
> 0.6280 0.1672 0.3395 0.2691 0.9831
>
> how can i get the following result which is the lower triangular matrix on a column vector?
> is there a loop i could try?
> 0.3993
> 0.4317
> 0.1981
> 0.7379
> 0.9831
> 0.5269
> 0.0155
> 0.4897
> 0.2691
> 0.4168
> 0.9841
> 0.3395
> 0.6569
> 0.1672
> 0.6280
> thanks again

Well, the simplest answer is to ask if you can extract a
single diagonal? Then surely you can loop over that,
concatenating the results.

John