Hello, I want to find a set J of indices , containing the r column pivots. I want to apply CPQR on a matrix X but I don't know how to do it.
Thank you,

 채택된 답변

Raag
Raag 2026년 3월 6일

1 개 추천

Hi Haidar,
It is my understanding that you want to perform Column Pivoting QR decomposition (CPQR) on a matrix 'X' and extract the set of pivot column indices, possibly to identify the 'r' most important columns or perform rank-revealing factorization.
In MATLAB, you can perform CPQR using the 'qr' function with an output argument for the permutation information. When you call qr with three output arguments, MATLAB returns the orthogonal matrix 'Q', the upper triangular matrix 'R', and a permutation matrix or vector 'E' that describes the column pivoting. The permutation information in 'E' tells you which columns were selected as pivots and in what order. Depending on the syntax you use, 'E' can be returned either as a permutation matrix or as a permutation vector containing the column indices directly.
To identify the first 'r' pivot columns, you can examine the diagonal entries of 'R' to determine numerical rank, or simply take the first 'r' entries of the permutation vector. The pivoting strategy in 'qr' is designed to reveal numerical rank by placing the most significant columns first. If you need more control over the rank determination or threshold, you may also want to look into the singular value decomposition (SVD) as an alternative approach for rank-revealing factorization.
You can refer to the following documentations for more information:

댓글 수: 1

Newlearner
Newlearner 2026년 3월 6일
Thank you so much, this is exactly what I wanted to know. I think qr is sufficient for now.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2026년 2월 28일

댓글:

2026년 3월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by