Symmetric matrix - MATLAB Cody - MATLAB Central

Problem 742. Symmetric matrix

Difficulty:Rate

You must create a n-by-n symmetric matrix such that A(row,col) = row/col for col >= row.

Example if n =3 :

output is : A =

      1.0000    0.5000    0.3333
      0.5000    1.0000    0.6667
      0.3333    0.6667    1.0000

since A(2,1) = A(1,2) = 1/2

or A(3,1)= A(1,3) = 1/3

Solution Stats

53.97% Correct | 46.03% Incorrect
Last Solution submitted on May 06, 2025

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
3
6

Problem Recent Solvers324

Suggested Problems

More from this Author30

Problem Tags

Community Treasure Hunt

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

Start Hunting!