For symbolic inputs, there is no tand(), atand(), atand2(), cosd(), acosd(), sind(), or asind() .
You need to convert the argument to radians yourself, or define sind and so on yourself. For example,
Pi = sym('pi');
sinD = @(x) sin(x*Pi/180);
cosD = @(x) cos(x*Pi/180);
tanD = @(x) tan(x*Pi/180);
atanD = @(x) atan(x) * 180/Pi;
atanD2 = @(y,x) atan2(y, x) * 180/Pi;
ea = m + (180/pi20)* ec * sinD(m)* (1 + ec * cosD(m));
keeplooping = true;
while ea > 0.005
E1 = (ea - (180/pi20)* ec * sinD(ea)-m)/(1 - ec * cosD(ea));
E1 = ea;
keeplooping;
if ea <= 0.005
keeplooping = false
return
end
end
v = 2 * atanD((sqrt(1+ec))* tanD(ea/2));
r = (a *(1-(ec^2))/(1+ec* cosD(v)));
x = cosD(ea) - ec;
y = sinD(ea) * sqrt(1 - ec* ec);
r = sqrt(x*x + y*y);
v = atanD2(y,x);
Best Answer