Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can anyone help me do this on MATLAB? Please do not change the variables, they n

ID: 3777067 • Letter: C

Question

Can anyone help me do this on MATLAB? Please do not change the variables, they need to be the same. Thank you very much.

l. (10 points The sine function can be evaluated via the following infinite series: Sin, (a) Write a function approxSine that takes as input two parameters, x and threshold, to perform the following task. Starting with the initial approximation sin (a) r, add terms one at a time to improve this estimate until true value approximation. threshold. true value Assume that the true value of sine is the one returned by the built-in sin function in MATLAB. Your function must return two output values: the approximate value of sin(r) and the number of terms that were needed to obtain this value subject to the desired error threshold. The following is an example of function behavior for T/5 x pi/5; true value sin (x) real 0.58 78 threshold 0.001 approx terms approx Sine (x, threshold) approx 0.5878 terms threshold 0.00001 approx terms approx Sine (x, threshold) approx 0.5878 terms Note that the terms value returned by the function only counts the number of terms added to the starting approximation of sin(a).

Explanation / Answer

f= input('enter the frequency in hertz of the circular function wave');
t=0:.0001:5;
y=sin(2*pi*f*t);
plot(t,y);
ylabel ('Amplitude');
xlabel ('Time Index');
TITLE ('Sine wave');
f= input('enter the frequency in hertz of the circular function wave');
t=0:.0001:5;
y=cos(2*pi*f*t);
plot(t,y);
ylabel ('Amplitude');
xlabel ('Time Index');
TITLE ('cosine wave');

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote