how to generate symmetric matrix with zero-one elements, complexity index of this matrix (number of ones / (size )^2) = any number from zero to 1 and diagonal equal ones

조회 수: 5 (최근 30일)
how to generate symmetric matrix with zero-one elements, complexity index of this matrix (number of ones / (size )^2) = any number from zero to 1 and diagonal equal ones???
  댓글 수: 1
Star Strider
Star Strider 2016년 1월 23일
@Hayam — I thought you might be the only person who wanted the matrix, but it’s gotten several downloads in the 8 hours since I uploaded it!

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2016년 1월 22일
I have no idea if anyone else will ever use it, but it was intriguing enough as a problem for me to make it reasonably robust and put it up on the File Exchange. I’ll take it down eventually if it doesn’t generate any other interest.

추가 답변 (1개)

Triveni
Triveni 2016년 1월 22일
편집: Triveni 2016년 1월 22일
A = [1 2 3 4 5; 1 2 3 4 5; 1 2 3 4 5];
symmetry = [A, flip(A)];
if you need diagonal as ones use
B =diag(symmetry) ==ones;

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by