# Matlab, QR with columns pivoting

Is there any sample matlab code computing QR decomposition with columns pivoting for a matrix?

I do not need an internal function, I would like to know the method...

MATLAB has a built-in function that would get the job done: mathworks.com/help/matlab/ref/qr.html –  Shuhao Cao Nov 15 '12 at 23:16
Since Matlab already implements QR decompoistion, you can check to see if the 'm' file is readable (try open qr.m). It is unlikely that anyone would re-implement functionality which is already present, unless they do it as an exercise to learn. You are better off checking for code in other languages and editing it for Matlab. In that case, you may want to check Octave code (which is open). btw if your doing it for HW, try to do it on your own first instead of just copying. –  mythealias Nov 15 '12 at 23:31