Skip to content

Instantly share code, notes, and snippets.

@lorenrogers
Created March 15, 2016 14:17
Show Gist options
  • Select an option

  • Save lorenrogers/07ee9049eab3aaf60738 to your computer and use it in GitHub Desktop.

Select an option

Save lorenrogers/07ee9049eab3aaf60738 to your computer and use it in GitHub Desktop.
function output = FindBasis(A)
%find the number of times to loop through the array (height)
[height width] = size(A);
%set up temp var
tmp = A(1,:)
%loop through all the vectors we are potentially going to add on
for i=2:height
if rank([tmp;A(i,:)]) > rank(tmp)
tmp = [tmp;A(i,:)]
end
end
output = tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment