Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions