Square matrix input, output same elements in upper right triangle
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Any pointers on this one? I'm not looking for just an answer, I want to understand why and how it works so I can use this in the future. Matrix B referenced in the question is B=[-6 0 4; -2 8 3; 7 0 1]

0 Kommentare
Akzeptierte Antwort
KALYAN ACHARJYA
am 26 Aug. 2019
Bearbeitet: KALYAN ACHARJYA
am 26 Aug. 2019
>> magic(6);
>> triu(ans);
Here
B=[-6 0 4; -2 8 3; 7 0 1];
result=triu(B)
Also, you can do the same in multiple ways (without inbuilt function)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!