Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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|cite|improve this question

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


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


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

share|cite|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

Your Answer


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.