Avoid reading diagonal and redundant symmetric elements
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I would like to create a matlab function that reads matrix elements and print only those elements which are non diagonal and redundant.
For example,
A = [
1 2 3
2 5 6
3 6 7]
The function should only print; 2, 3, 6
Thank you a lot
댓글 수: 0
채택된 답변
Peng Li
2020년 3월 26일
use tril or triu function to get the lower or upper triangular matrix. Or use diag to get nonmain diagonal elements.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 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!