Ploting a series and finding lim to infinity

3 visualizzazioni (ultimi 30 giorni)
Destro Katramis
Destro Katramis il 30 Mag 2020
Modificato: madhan ravi il 30 Mag 2020
Hello everyone, having compute the following series:
n=1:100;
a(1)=1/3;
a(2)=2/7;
a(n+2)=a(n+1)/(n+1)*a(n);
I want to plot the following ratio: a(n+1) / a(n) with the highest possible n and its limit towards infinity.
Thank you in advance!
  2 Commenti
KSSV
KSSV il 30 Mag 2020
What have you tried?
Destro Katramis
Destro Katramis il 30 Mag 2020
Well something embarassing like this:
seq=zeros(1,100);
for n=1:100
seq(n)=a(n+1)/a(n);
end
plot(seq)

Accedi per commentare.

Risposte (1)

madhan ravi
madhan ravi il 30 Mag 2020
Modificato: madhan ravi il 30 Mag 2020
N = 1e2; % an inf number
a = zeros(1,N);
a(1) = 1/3;
a(2) = 2/7;
for n = 1:N-2
a(n+2) = a(n+1) / (n+1) * a(n); % not sure whether if it should be ((n+1) * a(n))
end
seq = a(2:end) ./ a(1:end-1);
plot(seq)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Prodotti


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by