Create a diagonal matrix from a vector

2 ビュー (過去 30 日間)
pavlos
pavlos 2012 年 10 月 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 日
What is "m"?
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 Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by