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

This problem needs to be solved in matlab using a custom function, cant quite fi

ID: 1970452 • Letter: T

Question

This problem needs to be solved in matlab using a custom function, cant quite figure out

function phi = prob2_6(n) is the start of the custom function

test cases:
n = 5 -> phi = 1.618034154176712
n= 10 -> phi = 1.618033988674355
n= 50 -> phi = 1.618033988749895 (cases to try for n)

(18) The golden ratio, , can be approximated by a summation as shown belovw. Given a positive scalar integer n, create a function (prob2_6.m) to calculate the scalar sum of the first n terms of the series defined by: 13 (-1)n+1(2n + 1)! Your function needs to work only for integers values of 1 n 50 Hint: use the FACTORIAL function. Be sure to use " and Use the suM function and make a vector that goes from 0n where appropriate. SUM

Explanation / Answer

function phi =prob2_6(n)
format long
k=0:n;
phi1=((((-1).^(k+1)).*factorial(2.*k+1))./(factorial(k+2).*factorial(k).*(16.^(k+1))));
phi=sum(phi1);
phi=phi+(13./8);

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