Cutting a Matrix Into a Triangle

2 ビュー (過去 30 日間)
Pranav Murali
Pranav Murali 2020 年 7 月 6 日
回答済み: Rik 2020 年 7 月 6 日
Hey guys,
I know MATLAB has the triu and and tril functions that cut the upper and lower triangular portion of a matrix. The cut is made from the top left corner of the matrix to the bottom right corner of the matrix, like this image.
I have a 78x125 matrix and was wondering if there was a way to cut it from the top right corner to the bottom left corner?
Thanks,
Pranav Murali

回答 (1 件)

Rik
Rik 2020 年 7 月 6 日
Use fliplr to mirror the matrix, then use tril or triu, then mirror again with fliplr.

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by