Question please do this in MATLAB pls follow all requirements, you can try to do the extra credit but that part isnt necessary. thank you! Objectives: Learn how to write a convergent algorithm using Taylor series For Taylor Series, Read the Taylor documents included with this Lab. Study the series to see how it converges. Note that for these Trig functions Taylor converges quickly. The number of terms will vary based on the size of the angle and the size of epsilon. Requirements: Write the program using Dialog buttons and a while loop to continue until users chooses to stop program. 1. Use Dialog buttons to select the sine, cosine, or sinh. Ask the user to input k (global) in the script before you start the dialog buttons. In each case respectively: a. Have the user enter the angle. You can choose degrees or radians noting that radians are required as the parameter for the Matlab and your functions. b. call your trig function that you wrote using Taylor series (see item 4) c. call the standard trig function in Matlab. Output the answers to 4 significant digits for your function and the Matlab function to compare accuracy. Use the global k example to vary the accuracy. Find a k that lets your function be equivalent to the Matlab function. (We will use your function in a future lab.). Write the 3 functions using Taylor series for sine, cosine, and sinh using -k to control convergence. k must be a global variable. These can be embedded or external functions. Test these functions and create a table of values per the table below: (10PTS EXTRA CREDIT Instead of hand writing table Create an array for these answers and write them to an excel file.)

FHBZY9 The Asker · Computer Science

please do this in MATLAB
 

pls follow all requirements, you can try to do the extra credit but that part isnt necessary. thank you!

 

Transcribed Image Text: Objectives: Learn how to write a convergent algorithm using Taylor series For Taylor Series, Read the Taylor documents included with this Lab. Study the series to see how it converges. Note that for these Trig functions Taylor converges quickly. The number of terms will vary based on the size of the angle and the size of epsilon. Requirements: Write the program using Dialog buttons and a while loop to continue until users chooses to stop program. 1. Use Dialog buttons to select the sine, cosine, or sinh. Ask the user to input k (global) in the script before you start the dialog buttons. In each case respectively: a. Have the user enter the angle. You can choose degrees or radians noting that radians are required as the parameter for the Matlab and your functions. b. call your trig function that you wrote using Taylor series (see item 4) c. call the standard trig function in Matlab. Output the answers to 4 significant digits for your function and the Matlab function to compare accuracy. Use the global k example to vary the accuracy. Find a k that lets your function be equivalent to the Matlab function. (We will use your function in a future lab.). Write the 3 functions using Taylor series for sine, cosine, and sinh using -k to control convergence. k must be a global variable. These can be embedded or external functions. Test these functions and create a table of values per the table below: (10PTS EXTRA CREDIT Instead of hand writing table Create an array for these answers and write them to an excel file.)
More
Transcribed Image Text: Objectives: Learn how to write a convergent algorithm using Taylor series For Taylor Series, Read the Taylor documents included with this Lab. Study the series to see how it converges. Note that for these Trig functions Taylor converges quickly. The number of terms will vary based on the size of the angle and the size of epsilon. Requirements: Write the program using Dialog buttons and a while loop to continue until users chooses to stop program. 1. Use Dialog buttons to select the sine, cosine, or sinh. Ask the user to input k (global) in the script before you start the dialog buttons. In each case respectively: a. Have the user enter the angle. You can choose degrees or radians noting that radians are required as the parameter for the Matlab and your functions. b. call your trig function that you wrote using Taylor series (see item 4) c. call the standard trig function in Matlab. Output the answers to 4 significant digits for your function and the Matlab function to compare accuracy. Use the global k example to vary the accuracy. Find a k that lets your function be equivalent to the Matlab function. (We will use your function in a future lab.). Write the 3 functions using Taylor series for sine, cosine, and sinh using -k to control convergence. k must be a global variable. These can be embedded or external functions. Test these functions and create a table of values per the table below: (10PTS EXTRA CREDIT Instead of hand writing table Create an array for these answers and write them to an excel file.)
Community Answer
KEHBV0

Note: For indentation of the code follow the bellow screenshots of the program. Kindly remove the extra line space in both programs than it will execute perfectly. Refer the screenshots to indent the code in your editor. Screenshots of the program:     Sample output: InputEnter k angle in degrees:45 Dialog buttonsSelect the sine, cosine, or sinhsinecosinesinh click on sine button ≫ taylor_seriesTylor_series_sine =0.7071 and Trig sine =0.7071 ContinueDo you want to continue..Yes Stop click on yes InputEnter k angle in degrees:45 Dialog buttonsSelect the sine, cosine, or sinhsinecosinesinh click on cosine button ≫ taylor seriesTylor series_sine =0.7071 and Trig sine =0.7071Tylor series coine =0.7071 and Trig cos =0.7071 ContinueDo you want to continue..Yes Stop click on yes InputEnter k angle in degrees:45 Dialog buttonsSelect the sine, cosine, or sinhsinecosinesinh click on sinh button ≫ taylor_seriesTylor_series_sine =0.7071 and Trig sine =0.7071Tylor series coine =0.7071 and Trig cos=0.7071Tylor series sinh =1.0833 and Trig sinh =0.8687 Click on stop to exit ContinueDo you want to continue..Yes Stop   Code to copy:     Tylor_series.m: warning off; while (1)     %read k value from the user     in = inputdlg('Enter k angle in degrees: ','Input',[1 40]);     %user dialog buttons     choice = questdlg('Select the sine, cosine, or sinh', ...     'Dialog buttons','sine','cosine','sinh','stop');       % Handle response      k = str2num(in{1});     %convverting fron degree to radian     r = k * pi/180;      %check the user choice    switch choice        case 'sine'            %call function Tylor_series_sine            T = Tylor_series_sine(r);            %call Trig sin funcion for comparision            s = sin(r);            fprintf('Tylor_series_sine = %1.4f ',T)            fprintf('and Trig sine = %1.4fn',s);        case 'cosine'            %call function Tylor_series_sinh            T = Tylor_series_cosine(r);            %call Trig cos funcion for comparision            s = cos(r);            fprintf('Tylor series coine = %1.4f ',T)            fprintf('and Trig cos = %1.4fn', s);   &#1 ... See the full answer