Avoid reading diagonal and redundant symmetric elements

2 ビュー (過去 30 日間)
Mo H
Mo H 2020 年 3 月 26 日
コメント済み: Mo H 2020 年 3 月 29 日
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

採用された回答

Peng Li
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 ExchangeOperating on Diagonal Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by