Square matrix input, output same elements in upper right triangle
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
KALYAN ACHARJYA
2019년 8월 26일
편집: KALYAN ACHARJYA
2019년 8월 26일
>> 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)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!