Question: I have a 5x5 matrix 

```
A = 
   [0    0    0    0    1; 
    0.36 0    0    0    1; 
    0    0.25 0    0    1; 
    0.35 0    0    0    1;
    0    0    0.28 0    1]; 

```

I want to extract lower triangular elements of the matrix without considering the diagonal elements. Therefore, resulting matrix should be

```
C = [0.36 0 0.35 0 0.25 0 0 0 0.28 0]

```

Let me know how I can get this.

Answer: 
You can use matlab `tril`, e.g.:

```
index = find(tril(ones(size(A)), -1));
C = A(index);

```
I'm assuming this is Matlab, based on the format of the matrices.

If you want the elements of the lower triangular portion in a row vector, you can do it with a loop (although I'm sure somebody will have a nifty vectorized approach):

```
C=[];
for n=1:size(A,1)
    C=[C,A(n+1:end,n)'];
end

```

The output is:

```
C =

  0.36  0.00  0.35  0.00  0.25  0.00  0.00  0.00  0.28  0.00

```

If instead you want the full 5x5 matrix, you would use the second argument of [`tril`](http://www.mathworks.com/help/matlab/ref/tril.html):

```
C = tril(A,-1);

```

The output is:

```
C =

  0.00  0.00  0.00  0.00  0.00
  0.36  0.00  0.00  0.00  0.00
  0.00  0.25  0.00  0.00  0.00
  0.35  0.00  0.00  0.00  0.00
  0.00  0.00  0.28  0.00  0.00

```