MATLAB Answers

tril showing dimension error

1 view (last 30 days)
Suchetana Gupta
Suchetana Gupta on 28 May 2015
I have an excel file where column 1 has values between 1-198 (not all of 1-198 are there and some values are repeating) and column 2 similarly has 1-198 values (again with absence of some and repetition of some). The third column has the associated edge weights. I want to create a graph from it and am using the formula: w=[]; DG=sparse([],[],w); UG=tril(DG+DG');
(My excel sheet obviously has same number of values on all three columns)
(My system thus has 198 nodes and I am willing to make a network where each node is connected to every other node in it, except itself and the one whose node number is i+1,i.e. for n nodes, I should be expecting n(n-2) connections, right?)
The tril operation is showing dimension error. Where am I going wrong?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by