Create a diagonal matrix from a vector

3 views (last 30 days)
Hello,
Consider a 1x7 vector.
How can I create a 7x7 matrix where the main diagonal elements are zeros (m(i,i)=0) and m(i,j)=m(j,i)?
where,
i=1,...,7 the rows index
j=1,...,7 the columns index
  2 Comments
Matt J
Matt J on 30 Oct 2012
Edited: Matt J on 30 Oct 2012
You should edit your post's title. This isn't really asking for a "diagonal matrix".

Sign in to comment.

Accepted Answer

Matt J
Matt J on 30 Oct 2012
Edited: Matt J on 30 Oct 2012
m(1)=0;
toeplitz(m)

More Answers (0)

Categories

Find more on Operating on Diagonal Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!