Create a diagonal matrix from a vector

3 次查看(过去 30 天)
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 个评论
Matt J
Matt J 2012-10-30
编辑:Matt J 2012-10-30
You should edit your post's title. This isn't really asking for a "diagonal matrix".

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2012-10-30
编辑:Matt J 2012-10-30
m(1)=0;
toeplitz(m)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by