Square matrix input, output same elements in upper right triangle
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
KALYAN ACHARJYA
le 26 Août 2019
Modifié(e) : KALYAN ACHARJYA
le 26 Août 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)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!