Hello! I would like to use rref function in order to remove the linearly dependent elements from my matrix , but when using rref I get the number of basic columns as 1 which is not correct! any suggestion of any potential error in my code will be very welcomed ! thank you in advance !
load('matFile.mat', 'MyMatrix') >> [rows, columns]=size(MyMatrix); >> reshapedMatrix = reshape(MyMatrix,(rows * columns),1); >> Gram = reshapedMatrix * reshapedMatrix'; >> GramDeterm = det(Gram); >> if (GramDeterm <0.1) [E,basiccol] = rref(Gram); MatrixOut = Gram(:,basiccol)'; end