MATLAB Answers

What type of function Matlab has help to construct symmetric matrix?

2 views (last 30 days)
Omar B.
Omar B. on 29 Jan 2020
Answered: Omar B. on 30 Jan 2020
What type of built-in functions (such as function Toeplitz) that come with Matlab help us to construct a symmetric matrix (not random) ?

  2 Comments

David Goodmanson
David Goodmanson on 30 Jan 2020
Hi Omar,
any matrix of your choosing can be made into a symmetric matrix of course with
A = (A+A.')/2

Sign in to comment.

Accepted Answer

Steven Lord
Steven Lord on 30 Jan 2020
Several of the matrices you can create using the gallery function are symmetric, and some have other interesting and/or useful properties.

  1 Comment

Sign in to comment.

More Answers (3)

James Tursa
James Tursa on 30 Jan 2020
If no specific properties needed, then you could use
n = the desired size
M = rand(n);
M = M + M';

  1 Comment

Omar B.
Omar B. on 30 Jan 2020
Thank you so much. I just want to learn more about the built - in function that can we use to create symmetric function.

Sign in to comment.


Walter Roberson
Walter Roberson on 30 Jan 2020
squareform() can convert a vector of values representing the upper triangle, into a full symmetric matrix.

  1 Comment

Sign in to comment.


Omar B.
Omar B. on 30 Jan 2020
Thank you so much . I really appreciate your help.

  0 Comments

Sign in to comment.

Sign in to answer this question.


Translated by