I need help with matrix problem!

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
>> +~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