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

the following equations define the first two terms of a sequence of numbers and

ID: 3578516 • Letter: T

Question


the following equations define the first two terms of a sequence of numbers and each subsequent term using a recursion formula. write a Matlab function to calculate the first n terms of this sequence, where n is specified by the user
a1=2
a2=-1
a sub(n+2)=a sub(n+1)/a sub(n) n=1,2,3,...
sub means subscript

B. (20 puials) The following equation- delitut Llue lire vwo tertiue of uuener of nurabers and rneh sobsequeuw terin usiris a recursion fortzula. Write a MATLAB funerinn to calcula the Lrel m veruns of this sequence, where must be epeilied by the uaer. 1.2.3

Explanation / Answer

function [ ] = series(n)

a1=2;

a2=-1;

a1

a2

for i = 3 : n

a3 = a2/a1;

a1 = a2;

a2 = a3;

a3

end

end