An iterative equation for solving the equation x2−x−1=0 is given by
xr+1=1+(1/xr) for r =0,1,2, …
Given x0 is 2 write a MATLAB script to solve the equation. Sufficient accuracy is obtained when |xr+1−xr|< 0.0005.=”” include=”” a=”” check=”” on=”” the=”” answer.1.13.=”” given=”” a=”” 4×5=”” matrix=”” a,=”” write=”” a=”” script=”” to=”” find=”” the=”” sums=”” of=”” each=”” of=”” the=”” columns=”” using:=””>
(a) the for … end construction
(b) the function sum
Given a vector x with n elements, write a MATLAB script to form the products
pk = x1x2 …xk−1xk+1 …xn
for k =1,2,…,n. That is, pk contains the products of all the vector elements except the kth. Run your script with specific values of x and n.