function y = Tsin(x,n)
x=input('Degrees: ');
y=input('Terms: ');
%Tsin calculates the sin using Taylor formula.
%Input arguments:
%x The angle in degrees, n number of terms.
z=x*pi/180;
y=0;
for k=0:n-1
y=y+(-1)^k*z^(2*k+1)/factorial(2*k+1);
end
RUN then
>> Tsin(x, n)
Unrecognized function or variable 'x'.
Best Answer