Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

enter image description here

Here A square matrix and first figure(AU) shows undirected connection graph and second one shows directed one.Assume that only i have Au metrix and how can i create Ad metrix from Au matrix in matlab?

share|improve this question
add comment

1 Answer

If you have the possibility to change the direction of your vectors, take the upper triangular minus the lower triangular:

AD=triu(AU)-tril(AU)

And if you do not want the -1 elements, add

AD(AD==-1)=0

This will direct all your vectors from the smaller to the greater number: 1->2, 2->3, etc ...

share|improve this answer
    
for i=1:N AD( i, AU(randperm(length(AU))) ) = 1; end yes i thought it also but then matrix is not irreducible(strongly connected) as first row (or column)= 0 –  Toto Apr 16 '13 at 11:38
    
@Toto: You've already wasted my time by changing the question once (twice if you count the inclusion of Matlab). Now you want to waste Jonas' time by changing it again? –  Douglas S. Stones Apr 18 '13 at 16:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.