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.

Revisions

  1. Loren Rogers created this gist Mar 15, 2016.
    16 changes: 16 additions & 0 deletions FindBasis.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    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