Answered
Distances in a graph between two subset of nodes (Sources and Target)
Oh, great, now I understand the structure of the matrix. Sorry for the late answer. Here is how I would code this: R = zero...

9 years ago | 1

Answered
Distances in a graph between two subset of nodes (Sources and Target)
Probably the simplest way to do this would be to just compute all distances, and then use indexing into matrix D to get those di...

9 years ago | 1

Answered
Is it possible to display multiple edgelabels in a graph plot?
Here's an example of how to construct a custom label, using the new string class. With the older types char and cell array of ch...

9 years ago | 2

| accepted

Answered
how do I number the nodes of the graph from 0 to n-1 when i plot G?
Try plot(G, 'NodeLabel', 0:n-1)

9 years ago | 0

Answered
get authority and hub scores from centrality function
The description is a bit misleading here: the 'hubs' and 'authorities' values for all nodes are both basically singular vectors ...

9 years ago | 0

| accepted

Answered
Connected graph given adjacency matrix
I realize this is an old question, but since it's still getting visits, I have a small addition. As of R2015b, the new graph and...

9 years ago | 5

Answered
How do I classify networks by topology?
Sorry for picking this up months after the fact, I just happened on your question now. You can use the CONNCOMP command to ge...

9 years ago | 1

Answered
Removing duplicate edges?
If your duplicates are always one that is A->B and another B->A, Alexandra's elegant solution will work very well. If you hav...

9 years ago | 3

Answered
Performance problems with digraph structure
Generally speaking, it's much cheaper to construct a graph once, given all the nodes and edges, than incrementally using addnode...

9 years ago | 0

| accepted

Answered
Why the command "graphallshortestpaths" gives me Inf value for a weighted indirect graph that I know it doesn't have disconnections?
I'm not sure what function you are using to compute Dijkstra with a dense matrix - graphshortestpath for a dense matrix returns ...

9 years ago | 1

| accepted

Answered
opts.issym in eigs() - meaning
The options opts.issym and opts.isreal are only meant to be used when passing in a function handle for A. When a matrix A is ...

9 years ago | 2

| accepted

Answered
Plotting graph objects with curved edges and forced layout
You could try this: plot(G,'Layout','layered','Sources',1:5 ,'Sinks',6:10,'linewidth',LWidths); This will place all nodes ...

9 years ago | 0

| accepted

Answered
Different svd results with R2015b and R2016a
Both results are correct up to machine precision. The reason for the difference between MATLAB versions is that the MKL library ...

9 years ago | 0

| accepted

Answered
2 problem with new graph functions in Matlab 2015b
Sorry this is kind of a late answer. There is no function to compute the fundamental cut set from a minimum spanning tree in MAT...

10 years ago | 1

Answered
Adjacency matrix of a network to Distance matrix (Two -Hop)
An easier way to compute the two-hop matrix is through matrix multiplication, I think. The adjacency matrix A is the one-hop ...

10 years ago | 0

Answered
Using 'graph' for 3D representation.
You can get plot3 to show you the structure you're looking for as follows: >> xx = [x(s); x(t)] >> yy = [y(s); y(t)] ...

10 years ago | 0

Answered
Solve system of matrices
I don't think this can be solved in general. The matrices X and Y contain 8 scalar unknowns together, but there are 12 scalar eq...

10 years ago | 0

| accepted

Answered
How can I increase the calculation speed in using eig()?
If you need all the eigenvalues and all the eigenvectors, there's not faster way than eig, I'm afraid. Here's an older thread ab...

10 years ago | 0

Answered
Beginner: need help generating the right graph.
I'm afraid I don't quite understand the question. It sounds like you have a 150x88 matrix containing integers from 1 to 7, which...

10 years ago | 0

Answered
How are coordinates in plot(graph(M)) generated?
There are different layout methods for plotting a graph, which you can call as follows: plot(graph(M), 'layout', LAY); w...

10 years ago | 1

| accepted

Answered
Eigs Performance SA vs. SM
The reason is that eigs uses very different algorithms for the two versions. Here's what each algorithm does |'lm':| This is ...

10 years ago | 1

| accepted

Answered
Solving linear equations with errors only on LHS
Your proposal of computing the total least squares solution of the problem seems good. The scaling of b is important here: if yo...

10 years ago | 2

| accepted

Answered
Read MATLAB graph objects into Python
I don't know much about python loadmat and h5py files, but I don't think loading the MATLAB object graph would realistically wor...

10 years ago | 0

Answered
How to quickly fill in a matrix
Use spdiags: spdiags(repmat(phi([end:-1:1 1])', T), -10:0, T, T)

10 years ago | 0

Answered
Dijkstra's algorithm problem
Since R2015b, MATLAB has a class graph which provides a function shortestpathtree that does this algorithm for you: >> g = ...

10 years ago | 0

Answered
How to multiply 4D array.
You could try downloading the <http://www.sandia.gov/~tgkolda/TensorToolbox/index-2.6.html tensor toolbox> by Kolda and Bader, w...

10 years ago | 0

| accepted