Hello there!
I am writing a simple function but I can not understand why it will not work.
The error says "Not enough input arguments", right when the compiler is compiling the function I called ecc_anomaly.
Could you help me? I know the code is banal, though I can not fix it!
Thank you in advance!
The infamous function
function E = ecc_anomaly(tow, toe, GM, sqrta, M0, ecc)i = 0;M = M0+(tow-toe)*sqrt(GM/sqrta^6);a = M0; while i >= 10^-13 E = M0+ecc*sin(a); i = abs(E-a); a = E; endend
And finally my main
clcclear allformat longGM = 3.986005e14; % m^3/s^2
rotation = 7.2921151467e-5; % rad/s
tow = 223221; % s (self-check value)
%tow = 225445; % s
M0 = 1.94850072201; % rad
sqrta = 0.544062105942e+04; % m^0.5
ecc = 0.404827296734e-04; % unitless
toe = 0.225600000000e+06; % s
E = ecc_anomaly(tow, toe, GM, sqrta, M0, ecc);f = t_a(ecc, E);r = sqrta^2*(1-ecc*cos(E));x_1 = r*cos(f);x_2 = r*sin(f);
Best Answer