Answered
Is it possible to speed-up solving Ax=b for multiple b's by pre-computing the Cholesky factorization of A?
The main reason the first call is slower is that |R = chol(A)| for a sparse matrix tends to have a large amount of fill-in (that...

8 years ago | 5

| accepted

Answered
Approximation of 3D points with a 3D curve (path smoothing)
You could try the <https://www.mathworks.com/help/matlab/ref/smoothdata.html smoothdata> function, which would just smooth the x...

8 years ago | 0

Answered
eigs() runs faster for more eigenvalues of the same matrix
The reason is that the "search space" used in each iteration is determined based on the number of eigenvalues requested. By incr...

8 years ago | 3

| accepted

Answered
incosistent matrix multiplication and probelm with covarince matrix
A way to avoid computing negative eigenvalues is to work only on a part of the matrix: S2 = J*sqrt(C); %implicitly, S = S2...

8 years ago | 1

Answered
Edge Clutter Reduction in a Graph
I'm afraid there is currently no option for MATLAB's graph plot to do edge bundling.

8 years ago | 0

Answered
Why are my eigenvalues complex? (eig)
The eigenvalues of a real matrix are only real if the matrix is symmetric. The matrix C is not symmetric, therefore the eigenval...

8 years ago | 0

Answered
What's the truncation error in SVD?
Use |dsp = norm(ds(n+1:end)) / norm(ds)| instead of the sum. This is because in |norm(U*S*V', 'fro')|, you can move U and V o...

8 years ago | 0

Answered
Are there any codes to generate planar graphs in matlab or are there any large collections of planar graphs in matlab?
Can you give some more context on what kinds of planar graphs you are looking for? Are you trying to test an algorithm, maybe? ...

8 years ago | 0

Answered
Are there any codes to generate planar graphs in matlab or are there any large collections of planar graphs in matlab?
This is definitely the simplest way of generating random planar graphs in MATLAB, and should be reasonably quick (Delaunay trian...

8 years ago | 0

Answered
Are there matlab codes to compute cycle spaces of graphs?
There is no direct method to compute this in MATLAB's graph classes. From reading the wiki page, it seems that the following wil...

8 years ago | 2

Answered
Error with eigenvalues of unitary matrix
As mentioned in the comments above, if you are intending to compute all eigenvalues, it's best to call EIG, not EIGS. In fact, e...

8 years ago | 2

| accepted

Answered
How to convert graph to digraph?
I'm afraid it's not possible to have both directed and undirected edges in the same graph. To convert a graph to a digraph, you ...

8 years ago | 0

| accepted

Answered
Help with graphs - breadth search
This should be possible using the digraph object. Since you are modifying the graph, it may be best to write a for-loop that wil...

8 years ago | 0

Answered
computing SVD of very large matrix
The simplest way may be to use a computer with more memory - a matrix of size 1100000 x 1100 takes about 9GB of memory, which is...

8 years ago | 1

Answered
finding paths in a graph
I'm afraid I don't completely understand your question. In the strictest sense, what you describe is already done by dfsearch. H...

8 years ago | 0

Answered
Null is misbehaving if used within loops.
Try using null(Z) instead of null(Z, 'r') With the 'r' option, no tolerance for round-off errors in the matrix Z ...

8 years ago | 1

Answered
Sparse Matrix build efficiency
i) You should expect constructing a sparse matrix in a loop by adding elements using indexing A(i, j) = s to be slower than cons...

8 years ago | 0

Answered
bdschur algorithm in Matlab
According to the file bdschur.m, this uses LAPACK's DTRSYL and SLICOT's MB03RD functions. See >> edit bdschur

8 years ago | 0

| accepted

Answered
Overloading arithmetic on graphs or digraphs
I'm afraid methods for MATLAB's digraph class can't be overloaded. There is still a way to get what you want, but it may be mor...

8 years ago | 0

| accepted

Answered
Return conditional from mrdivide
You could use the linsolve function, with a second output argument: [x, rcond] = linsolve(A, b); This solves the linear s...

8 years ago | 1

| accepted

Answered
How to easily solve an equation of the form AX =B where A is a large sparse matrix???
P1: With the Finite Difference Method, the matrix will often be singular if there aren't sufficient boundary conditions added to...

8 years ago | 0

Answered
How to replace the diagonal elements of a matrix with 0 fro avoiding self loops?
If you are using the graph/digraph classes, you can also tell the constructor not to insert any self-loops for the diagonal elem...

8 years ago | 1

Answered
Calculate number of following nodes in a directed graph
For one particular node, you can use nearest(G, u, Inf) to get a list of all nodes that are reachable from node G, at any...

8 years ago | 0

| accepted

Answered
To get dominant eigen vector
I realize this is an old post, but this might be helpful to others: One reason for EIG to return complex values with very sma...

8 years ago | 0

Answered
How to change double matrix to float to avoid out of memory issue?
I'm afraid MATLAB doesn't support single sparse matrices. Do you get the out of memory error when calling the laplacian funct...

8 years ago | 0

Answered
How to get orthogonal eigenvectors for degenerate normal matrix?
I believe the Schur decomposition returns what you need. Here's an example % Construct a normal matrix U = orth(randn(100)...

8 years ago | 2

Answered
how can i use graph edit distance for n number of nodes
I'm afraid MATLAB does not provide functionality for computing the Graph Edit Distance. I took a look at the <https://en.wikiped...

9 years ago | 0

Answered
Product of two graphs in MATLAB
Without weights, you can compute the graph product quite quickly: A1 = adjacency(G1); A2 = adjacency(G2); I1 = speye(...

9 years ago | 3

| accepted

Answered
Select a node manually from a graph plot
Hi Alyssa, I'm not sure exactly what you are trying to do. The simplest thing would be to use the Data Cursor in your plot: C...

9 years ago | 0

Answered
All edges attached to given node in a (di)graph
There is currently no builtin for this, your lines with findedge are the simplest way to get the edge indices.

9 years ago | 0

Load more