Menu

[solved]-Need Help Matlab Using Recursion Please Notice Use Recursion Iteration Allowed Thank Help Q39033800

Need help on MATLAB by using Recursion!!!

Please notice that Only use Recursion.

Iteration is not allowed!!!

Thank you for your help!

Function Name: recyclePi

Inputs: 1. (double) The number of fractions to use in yourapproximation

Outputs: 1. (double) Your approximation of pi rounded to 10decimal places.

There are many ways to calculate r, and one of them is by using the continued fraction representation for (4 / t) 1, as shown

There are many ways to calculate r, and one of them is by using the continued fraction representation for (4 / t) 1, as shown below. You might notice that it has a very regular pattern. Each base number of the numerator increases by 2, starting from 1, with every nested fraction 12 4 1 2 32 52 72 92 112 2+. 2 TT 2+ 2+ 2+ 2+ Function Description: Using the continued fraction of (4 / i) + 1 given above, write a function that approximates T using the number of fractions given as the input. The number of fractions is determined by the number of fraction bars that appears when the continued fraction is written. Example: recyclePi (3) > approximation approximation => 2.8952380952 >> 4 12 4 1 2 + TT 12 32 2+ 52 2+ 32 52 2 2 + 2+ 2+ Notes: The continued fraction yields the approximation for (4 T)1, but your final solution should be an approximation of pi itself. Don’t be surprised if the approximations aren’t that close. Round your final approximation to 10 decimal places, and use it matches the solution output! isequal) to make sure Show transcribed image text There are many ways to calculate r, and one of them is by using the continued fraction representation for (4 / t) 1, as shown below. You might notice that it has a very regular pattern. Each base number of the numerator increases by 2, starting from 1, with every nested fraction 12 4 1 2 32 52 72 92 112 2+. 2 TT 2+ 2+ 2+ 2+ Function Description: Using the continued fraction of (4 / i) + 1 given above, write a function that approximates T using the number of fractions given as the input. The number of fractions is determined by the number of fraction bars that appears when the continued fraction is written. Example: recyclePi (3) > approximation approximation => 2.8952380952 >> 4 12 4 1 2 + TT 12 32 2+ 52 2+ 32 52 2 2 + 2+ 2+ Notes: The continued fraction yields the approximation for (4 T)1, but your final solution should be an approximation of pi itself. Don’t be surprised if the approximations aren’t that close. Round your final approximation to 10 decimal places, and use it matches the solution output! isequal) to make sure

Expert Answer


Answer to Need help on MATLAB by using Recursion!!! Please notice that Only use Recursion. Iteration is not allowed!!! Thank you f… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *