Answered
How to improve speed of calculating trace in a script?
You can make the trace operator work faster as follows: Currently, the input is two truncated SVDs, |A1 = U1 * S1 * V1'| and |A2...

8 years ago | 1

| accepted

Answered
How to find the permutation matrix for the qr decomposition?
You need to compute all three matrices together: Q and R are different if the third output e is also returned. For an algorit...

8 years ago | 2

| accepted

Answered
How to find the permutation matrix for the qr decomposition?
I'm afraid using the three-output syntax is the only way. You can use [~, ~, p] = qr(A); but Q and R are still computed,...

8 years ago | 0

Answered
Nonconvex: Checking positive-s​emidefinit​eness inside the Gloptipoly package
For positive definiteness, I would recommended to check this using CHOL (see if the second output registers a problem), but this...

8 years ago | 0

| accepted

Answered
Order of eigenvalues depending on matrix equation order of operations
The reason for the difference in this case is that matrix B is exactly symmetric, and matrix A is not. EIG detects if the input ...

8 years ago | 1

| accepted

Answered
Examining entries in binary matrices and creating new group matrix based on % of connections (defined by 1)
If you have each matrix stored in a separate variable, you can do Atotal = A1 + A2 + A3; % Sum of logical matrices is...

8 years ago | 0

Answered
inverse of matrix times vector
The problem is probably that the vector x is not exactly symmetric (because of floating-point errors). You can try just symmetri...

8 years ago | 0

| accepted

Answered
How to view/plot decomposed matrix from decomposition function
Hi, I'm afraid the decomposition object does not provide access to the factors of the decomposition. This is because, dependi...

8 years ago | 0

Answered
Eigenvalues of a 2000x2000 matrix
EIG chooses between the symmetric and non-symmetric solver based on whether the matrix is exactly symmetric (A == A'). I'm guess...

8 years ago | 0

Answered
graphshortestpath function visiting all nodes
As Steve Lord has said, in general this is an NP-complete problem, so could become quite expensive. For the 6-node graph you are...

8 years ago | 1

Answered
How does matlabs eigs normalise eigenvectors?
If the matrix B is symmetric positive definite, the eigenvectors are normalized in B-norm (and even orthogonal in B-norm if A is...

8 years ago | 0

Answered
Preserving node names in a digraph
Unfortunately, there is no direct way of doing this. The graph and digraph classes are designed to be fast when working on an ex...

8 years ago | 0

Answered
What is the space complexity of built-in eigs function in MATLAB
The largest memory requirement for |eigs| is for an array that stores a subspace of vectors, which has |size(A, 1)| rows and a n...

8 years ago | 1

| accepted

Answered
Using plot to generate a graph of a directed graph, how can i turn off the color of some lines
You can set the LineStyle property of these edges to 'none', which will make them not display. p = plot(gr4,'layout','circl...

8 years ago | 0

Answered
Error when plotting a small digraph
This bug was fixed in R2016b. I'm afraid there is no workaround except to check for the error and use another layout method ('ci...

8 years ago | 0

| accepted

Answered
Matlab code for this type of factorization.A has a SR decomposition A = SR , where S ∈ R^ 2n ×2n is a symplectic matrix, i.e. S ^TJS = J
I'm not very acquainted with the SR decomposition (all I know about it I found just now by googling). I would suggest to take a ...

8 years ago | 0

| accepted

Answered
I have make a code for block Kronecker product when both A and B have even dimension now myquestion (I want to make a code when A and B have are not even and also A is square and B is rectangular and vice versa)
I'm not sure how to do this, but take a look at the implementation of |kron| in MATLAB: edit kron.m You'll see that it us...

8 years ago | 0

| accepted

Answered
How to create a matrix B=[bij]=[max(i,j)] belongs to class of rectangular matrices
Focusing on the max(i, j) part, you could use i = 3; j = 4; B = max((1:i)', (1:j));

8 years ago | 0

Answered
How can I find a matrix which is orthogonal to another matrix?
The concept of orthogonality for a matrix is defined for just one matrix: A matrix is orthogonal if each of its column vectors i...

8 years ago | 0

Answered
Some questions on out of memory issues
Hi, 1- The eig function makes an internal copy of the input matrix, because the algorithm for computing the eigenvalues modif...

8 years ago | 1

Answered
SVDS fails to find the requested number of singular values
The algorithm used in SVDS was rewritten for R2016a (and Name-Value pairs such as 'SubspaceDimension' were added in R2017b - the...

8 years ago | 0

| accepted

Answered
Error in eigs when using Matlab 2017b?
Thank you for pointing out this bug. There is now a <https://www.mathworks.com/support/bugreports/1724250 bug report> available ...

8 years ago | 1

Answered
I am experiecing strange behavior with mrdivide/ mldivide and sparse/full matrices. How can I optimize my code ?
There is a bug in R2017a and R2017b which makes the MA57 solver work significantly more slowly (a necessary pre-processing step ...

8 years ago | 2

| accepted

Answered
Solving A{k} * x + b = 0 for large numbers of A{k} with same structure/filling.
In Tim Davis' C++ library UMFPACK, there are two phases to computing the decomposition of a matrix: The first one only uses the ...

8 years ago | 2

| accepted

Answered
singular matrix inverse using svd in 2016 and 2013 version of a matlab
Take a look at the code of PINV ( |edit pinv| ), which is using the SVD to compute the pseudo-inverse of a matrix. |x = pinv(A)*...

8 years ago | 1

Answered
MATLAB 2016a and 2017a give different results when multiplying by the complex conjugate
This is wrong behavior: the diagonal of matrix Rxx should have zero imaginary part. We will work on fixing this for a future rel...

8 years ago | 0

| accepted

Answered
Eigen values Form : A*[phi] = beta*B*[phi]
[U, D] = eig(A, B); gives you what you are looking for. All possible values of beta (eigenvalues of (A, B)) are on the diago...

8 years ago | 0

| accepted

Answered
Get node names after a graph condensation
Here is some code that does this: bins = conncomp(G); compNames = cell(max(bins), 1); for ii=1:length(bins) if ise...

8 years ago | 4

| accepted

Answered
MATLAB crashing when trying to solve 100k x 100k linear system
On Linux and Mac, programs that use nearly all of the system memory are sometimes killed by the operating system, in such a way ...

8 years ago | 1

Answered
How to do Delaunay Triangulation and return an adjacency matrix?
If your goal in computing the adjacency matrix is to construct a graph object, you can also do that (a bit) more directly: %...

8 years ago | 1

| accepted

Load more