Filter löschen
Filter löschen

Avoid reading diagonal and redundant symmetric elements

2 Ansichten (letzte 30 Tage)
Mo H
Mo H am 26 Mär. 2020
Kommentiert: Mo H am 29 Mär. 2020
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

Akzeptierte Antwort

Peng Li
Peng Li am 26 Mär. 2020
use tril or triu function to get the lower or upper triangular matrix. Or use diag to get nonmain diagonal elements.

Weitere Antworten (0)

Kategorien

Mehr zu Operating on Diagonal Matrices 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!

Translated by