% COLSPACE(A) Returns a basis for the column space of A % This is a sample MATLAB .m file that discards linearly % dependent columns from the matrix A. % This is a demo file for Math 63. function B = colspace(A) B=[]; for i=1:size(A,2) x = A(:,i) if rank([B x]) > rank(B) B = [B x]; end end