Hello guys.I am new to matlab.How can i make matrix(7x7) ,main diagonal all zeros, other elements 1?

 採用された回答

Stephen23
Stephen23 2016 年 3 月 10 日
編集済み: Stephen23 2016 年 3 月 10 日

1 投票

>> +~eye(7)
ans =
0 1 1 1 1 1 1
1 0 1 1 1 1 1
1 1 0 1 1 1 1
1 1 1 0 1 1 1
1 1 1 1 0 1 1
1 1 1 1 1 0 1
1 1 1 1 1 1 0

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File 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