All pastes #383880 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-06 17:46 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)
A = 1/a^2;
B = 1/b^2;
E = sum(abs(((x - x0).^2 .*A) + ((y - y0).^2 .*B) - 1).^2)