Question: Given my_sine(x,y): function xsin = my_sin ( x , n ) xsin = 0 ; for i = 1 : n % if it odd
Given my_sine(x,y):
function xsin = my_sin(x , n)
xsin = 0;
for i = 1 : n
% if it odd number term
if mod(i , 2) ~= 0
xsin = xsin + ( x ^ ( 2 * i - 1 ) ) / factorial( 2 * i - 1 );
% if it even number term
else
xsin = xsin - ( x ^ ( 2 * i - 1 ) ) / factorial( 2 * i - 1 );
end
end
end

2. Write a MATLAB function that uses my_sine(x,n) to plot the approximation of the sine function from-T to with increments equal to r, where Ar and n (the number of terms used in the series approximation) should be input arguments of the function and should be specified by the user. The framework for this function could look like this: function sine plot (deltax,n) end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
