How to extract the diagonal of a given matrix?
8 ビュー (過去 30 日間)
古いコメントを表示
How can I extract the diagonal of a given matrix with using size? I know we can do it directly with diag.
5 件のコメント
José-Luis
2017 年 9 月 7 日
Read the documentation on ind2sub() and sub2ind(). Having done that and using the fact that the diagonal of a square matrix is where I == J (keeping the nomenclature from the documentation) would allow you to solve your problem.
採用された回答
その他の回答 (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!