degree=input('Enter the value of x in degrees to compute sin(x): ');rad=(pi/180)*degree;x=raderror=1;n=0;while error >=(10^-5); terms = ((-1)^n)*(((x^(n+1)))/factorial(n+1)); dsin=sum(terms); n=n+1; error=abs((sin(x)-dsin)/sin(x))*100; enddisp(['dsin(x)= ',num2str(dsin)])Enter the value of x in degrees to compute sin(x): 90x = 1.5708dsin(x)= NaN
MATLAB: I cant figure out why the function is giving me NaN and not an answer
codingsin functiontaylor series
Best Answer