[Solved] Writing a function that calculates sine for inputted number of terms. MATLAB [closed]
found the answer myself.. note that there is a difference between sinx and sin(x) function [sinx, error] = sinx_approx(x) % approximates the value of sin(x), the approximation is more accurate as % the number of terms selected is increased. n= input(‘Up to how many terms would you like to evaluate?’); sinx=0; for i=1:1:n sinx=(-1)^(i+1) * … Read more