create an increasing series
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
ektor
el 21 de Sept. de 2023
Editada: Walter Roberson
el 21 de Sept. de 2023
Hi all,
I want to create
5
5(1+0.2^2)=
5(1+0.2^2+0.2^4)=
5(1+0.2^2+0.2^4+0.2^6)=
5(1+0.2^2+0.2^4+0.2^6+0.2^8)=
and so one up to 25 times.
Is there a way to do that in matlab?
Thank you!
0 comentarios
Respuesta aceptada
Voss
el 21 de Sept. de 2023
r = 0.2;
n = 25;
m = 5;
V = m*r.^(2*(0:n-1));
S = cumsum(V);
format long g
disp(S.')
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!