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

 Réponse acceptée

Stephen23
Stephen23 le 10 Mar 2016
Modifié(e) : Stephen23 le 10 Mar 2016
>> +~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

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by