All pastes #383869 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-06 17:36 UTC
rendered paste body
function E = planet_fit(coeff)
load planet.dat;
x = planet(:,2)
y = planet(:,3)
a = coeff(1)
b = coeff(2)
x0 = coeff(3)
y0 = coeff(4)
E = sum( abs(((x - x0).^2 / (a.^2)) + ((y - y0).^2 / (b^.2)) - 1).^2  );