I need to extract the elements of the main diagonal of the matrix:
I have tried the following solution:
[U S V]= svd (T)
lambda= reshape(S',[],1);
But I have got the column vector with all elements but I need only the elements of the main diagonal
I also have tried:
[U S V]= svd (T)
lambda = diag(S);
But It doesn't"t work
Can someone help me to extract the elements of the diagonal?