Professional Interests: numerical linear algebra, graph algorithms

Answered

Assign Numerical Node Labels

For the first call, use >> GG.Nodes.Name = num2str(Name)' - GG.Nodes.Name has to be a column vector. For the second call,...

Assign Numerical Node Labels

For the first call, use >> GG.Nodes.Name = num2str(Name)' - GG.Nodes.Name has to be a column vector. For the second call,...

22 hours ago | 0

| accepted

Answered

How to find inverse of a 608*608 matrix fast?

The matrices in this file are symbolic, it's very expensive to compute with large arrays of these variables. If you cast it to f...

How to find inverse of a 608*608 matrix fast?

The matrices in this file are symbolic, it's very expensive to compute with large arrays of these variables. If you cast it to f...

2 days ago | 0

| accepted

Answered

Is it possible to recover *the* decomposition that's ultimately employed by mldivide (backslash)?

The same decomposition is used, the difference is in the estimation of the condition number. MA57 provides an estimate of the co...

Is it possible to recover *the* decomposition that's ultimately employed by mldivide (backslash)?

The same decomposition is used, the difference is in the estimation of the condition number. MA57 provides an estimate of the co...

8 days ago | 3

Answered

"eig" use which algorithm to find eigenvalues

We don't give out the exact method used, but all syntaxes of EIG call into various LAPACK functions. See here for an introductio...

"eig" use which algorithm to find eigenvalues

We don't give out the exact method used, but all syntaxes of EIG call into various LAPACK functions. See here for an introductio...

14 days ago | 0

Answered

sortrows graph edges .

The variable G.Edges.EndNodes of a graph can't be modified, it is always sorted by the nodes in the graph. This is so that the p...

sortrows graph edges .

The variable G.Edges.EndNodes of a graph can't be modified, it is always sorted by the nodes in the graph. This is so that the p...

18 days ago | 0

Answered

How to find all the downstream nodes from a node in a graph?

You can call nearest(G, 1, Inf) which will find all nodes reachable from node 1 in an infinite radius. This will contain only...

How to find all the downstream nodes from a node in a graph?

You can call nearest(G, 1, Inf) which will find all nodes reachable from node 1 in an infinite radius. This will contain only...

25 days ago | 1

Answered

Find border edges of the graph

The graph class doesn't have any functions based on coordinates of the points - it just knows about their connections. Use conve...

Find border edges of the graph

The graph class doesn't have any functions based on coordinates of the points - it just knows about their connections. Use conve...

2 months ago | 1

| accepted

Answered

QR decomposition with the output of a permutation vector

The purpose of arranging all diagonal elements in descending order is to allow splitting R into two parts if A is low-rank or cl...

QR decomposition with the output of a permutation vector

The purpose of arranging all diagonal elements in descending order is to allow splitting R into two parts if A is low-rank or cl...

2 months ago | 0

| accepted

Answered

How to add highlighted nodes and edges of a graph to the legend?

The problem here is that legend will only provide labels for what graphics recognizes as individual objects. So in a line plot,...

How to add highlighted nodes and edges of a graph to the legend?

The problem here is that legend will only provide labels for what graphics recognizes as individual objects. So in a line plot,...

2 months ago | 1

| accepted

Answered

How to restore tensor after applied the PARAFAC model?

The three component vectors represent the 3 different dimensions here. For the one-component case (all are vectors), you can use...

How to restore tensor after applied the PARAFAC model?

The three component vectors represent the 3 different dimensions here. For the one-component case (all are vectors), you can use...

2 months ago | 0

| accepted

Answered

Create a graph from removed edges

The graph constructor has a syntax that specifies the number of nodes of the graph: graph(s, t, [], numnodes) if you pass the ...

Create a graph from removed edges

The graph constructor has a syntax that specifies the number of nodes of the graph: graph(s, t, [], numnodes) if you pass the ...

2 months ago | 0

| accepted

Answered

SVD computation using eig function

Try the formula the other way around, using U_tilde, V_tilde and A to compute D: >> U_tilde'*A*V_tilde ans = 70.0118 -0....

SVD computation using eig function

Try the formula the other way around, using U_tilde, V_tilde and A to compute D: >> U_tilde'*A*V_tilde ans = 70.0118 -0....

2 months ago | 0

| accepted

Answered

Using Singular value decomposition for feature extraction from images

Image compression using SVD is a pretty common example (although not the most efficient way to compress an image), here are some...

Using Singular value decomposition for feature extraction from images

Image compression using SVD is a pretty common example (although not the most efficient way to compress an image), here are some...

3 months ago | 0

Answered

Error using eig Input matrix contains NaN or Inf.

The function sossolve is part of a third-party tool, this seems to be their website: http://www.cds.caltech.edu/sostools/. It's ...

Error using eig Input matrix contains NaN or Inf.

The function sossolve is part of a third-party tool, this seems to be their website: http://www.cds.caltech.edu/sostools/. It's ...

3 months ago | 0

Answered

How to keep track of order eigenvalue in eig or eigs?

The eigenvalues returned by EIG are not sorted in any particular order generally (for some special types of matrices (e.g. exact...

How to keep track of order eigenvalue in eig or eigs?

The eigenvalues returned by EIG are not sorted in any particular order generally (for some special types of matrices (e.g. exact...

3 months ago | 1

Answered

Eigenvectors and the null function

I'm getting those two eigenvectors when I copy your code into MATLAB: >> D = [2 -1; -1 3]; eigs = eig(D); q1 = nu...

Eigenvectors and the null function

I'm getting those two eigenvectors when I copy your code into MATLAB: >> D = [2 -1; -1 3]; eigs = eig(D); q1 = nu...

3 months ago | 0

Answered

Block-diagonalization of a matrix

There is no direct function to do this. The best is probably to write a function that does a loop through the different blocks a...

Block-diagonalization of a matrix

There is no direct function to do this. The best is probably to write a function that does a loop through the different blocks a...

3 months ago | 0

Answered

How created a graph from unordered node list?

When a graph or digraph is specified using numbers, the assumption is that all nodes of this graph have numbers from 1:numberOfN...

How created a graph from unordered node list?

When a graph or digraph is specified using numbers, the assumption is that all nodes of this graph have numbers from 1:numberOfN...

3 months ago | 0

| accepted

Answered

nonsingular matrix (X) in GSVD function

These are just different but equivalent definitions: Both will result in the same C and S, the only difference is in how X is re...

nonsingular matrix (X) in GSVD function

These are just different but equivalent definitions: Both will result in the same C and S, the only difference is in how X is re...

3 months ago | 1

Answered

accuracy of two methods to solve eignvalues/eignvector problem

The second way is typically more accurate, because it doesn't incur additional round-off error when conputing inv(Sw) and when m...

accuracy of two methods to solve eignvalues/eignvector problem

The second way is typically more accurate, because it doesn't incur additional round-off error when conputing inv(Sw) and when m...

3 months ago | 0

| accepted

Answered

Sort eigenvectors matrix.

Take a look at rsf2csf. For a block-diagonal matrix with 1-by-1 and 2-by-2 blocks, it computes a diagonal eigenvalue matrix and ...

Sort eigenvectors matrix.

Take a look at rsf2csf. For a block-diagonal matrix with 1-by-1 and 2-by-2 blocks, it computes a diagonal eigenvalue matrix and ...

3 months ago | 1

Answered

Eigenvectors of an SPD matrix being saved as complex doubles

EIG does not recognize the input matrix as symmetric because it's not exactly symmetric. If you compute A = Y'*Mh*Y norm(A - A...

Eigenvectors of an SPD matrix being saved as complex doubles

EIG does not recognize the input matrix as symmetric because it's not exactly symmetric. If you compute A = Y'*Mh*Y norm(A - A...

3 months ago | 0

| accepted

Answered

Given a matrix A^n. Comparing normal multiplication versus Diagonalization. I expect the former to be faster but its not in my case

A^2 is just one matrix multiplication, A*A, which is much faster to do directly than the call to EIG. For larger n, A^n isn't ...

Given a matrix A^n. Comparing normal multiplication versus Diagonalization. I expect the former to be faster but its not in my case

A^2 is just one matrix multiplication, A*A, which is much faster to do directly than the call to EIG. For larger n, A^n isn't ...

4 months ago | 0

| accepted

Answered

how to random initialize svd function in matlab??

The linear algebra functions in MATLAB are run-to-run reproducible, meaning if you call them twice with the exact same input, yo...

how to random initialize svd function in matlab??

The linear algebra functions in MATLAB are run-to-run reproducible, meaning if you call them twice with the exact same input, yo...

4 months ago | 1

| accepted

Answered

EigenValues of a Vibrating system

Usually for finite element problems, the stiffness matrix is passed in as the first input, and the mass matrix as the second inp...

EigenValues of a Vibrating system

Usually for finite element problems, the stiffness matrix is passed in as the first input, and the mass matrix as the second inp...

4 months ago | 0

| accepted

Answered

issues with Cholesky decomposition

This can happen if your matrix is close to symmetric positive semi-definite (meaning the smallest eigenvalue is around machine e...

issues with Cholesky decomposition

This can happen if your matrix is close to symmetric positive semi-definite (meaning the smallest eigenvalue is around machine e...

4 months ago | 0

Answered

Can I preserve adding order when calling graph/addedge?

The edges in a graph are always presented in the same order (sort first by source node, secondarily be target node). You can mai...

Can I preserve adding order when calling graph/addedge?

The edges in a graph are always presented in the same order (sort first by source node, secondarily be target node). You can mai...

4 months ago | 1

| accepted

Answered

Display only one eigenvalue of symbolic matrix

The eigs function is not supported for symbolic values, as it is specifically based on getting a good approximation based on an ...

Display only one eigenvalue of symbolic matrix

The eigs function is not supported for symbolic values, as it is specifically based on getting a good approximation based on an ...

4 months ago | 0

Answered

how to do forward neighbor discovery in un-directed graph?

If I understand correctly, you want to find all nodes that are direct neighbors of n1, then all nodes that connect to n1 through...

how to do forward neighbor discovery in un-directed graph?

If I understand correctly, you want to find all nodes that are direct neighbors of n1, then all nodes that connect to n1 through...

5 months ago | 0

Answered

Using eigs with singular matrix

The 'smallestabs' option in eigs depends on solving several linear systems with the matrix A that's being passed in. If A is sin...

Using eigs with singular matrix

The 'smallestabs' option in eigs depends on solving several linear systems with the matrix A that's being passed in. If A is sin...

5 months ago | 0

| accepted