the following equations define the first two terms of a sequence of numbers and
ID: 3580516 • 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
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
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.