Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to check if a sparse matrix is symmetric?

Subject: How to check if a sparse matrix is symmetric?

From: Michelle

Date: 19 Jun, 2012 16:59:07

Message: 1 of 3

I have a sparse matrix that I cannot write in its full form (out of memory if I try)

The way I constructed my matrix, it is supposed to be a symmetric matrix but when I compute eigs it gives me complex values as a solution.

I'm pretty sure that matlab is not handling the symmetry. A start point for me would be to check if my sparse matix is symmetric.

Any suggestions? Thanks

Michelle

Subject: How to check if a sparse matrix is symmetric?

From: Matt J

Date: 19 Jun, 2012 18:31:06

Message: 2 of 3

"Michelle " <michellemirandaest@gmail.com> wrote in message <jrqb4r$s4c$1@newscl01ah.mathworks.com>...
> I have a sparse matrix that I cannot write in its full form (out of memory if I try)
>
> The way I constructed my matrix, it is supposed to be a symmetric matrix but when I compute eigs it gives me complex values as a solution.
==================

Is it real?


> I'm pretty sure that matlab is not handling the symmetry. A start point for me would be to check if my sparse matix is symmetric.
>
> Any suggestions? Thanks
==============


[i,j,s]=find(A);
[I,J,S]=find(A.');

issymetric=isequal([i,j,s], [I,J,S]);

Subject: How to check if a sparse matrix is symmetric?

From: Matt J

Date: 19 Jun, 2012 18:36:07

Message: 3 of 3

"Matt J" wrote in message <jrqgha$o1r$1@newscl01ah.mathworks.com>...
>
>
> [i,j,s]=find(A);
> [I,J,S]=find(A.');
>
> issymetric=isequal([i,j,s], [I,J,S]);

Forget that. Just do isequal(A,A.')

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us