Skip to content

Instantly share code, notes, and snippets.

@kanghyojun
Created March 19, 2014 07:57
Show Gist options
  • Select an option

  • Save kanghyojun/9637282 to your computer and use it in GitHub Desktop.

Select an option

Save kanghyojun/9637282 to your computer and use it in GitHub Desktop.
implement row echelon form;
function o = myref(A)
row = length(A(:, 1));
for i=1:1:row
current_row = A(i, :);
for j=i+1:1:row
compare_row = A(j, :);
f = current_row(1, i);
s = compare_row(1, i);
mult_row = current_row * (s / f);
A(j, :) = compare_row - mult_row;
end
end
o = A;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment