How to create a vector with a sequence 1, u, u(u-1), u(u-1)(u-2)....
Mostrar comentarios más antiguos
How to create a vector with a sequence 1, u, u(u-1), u(u-1)(u-2)....
5 comentarios
Rik
el 7 de Sept. de 2018
What have you tried so far, and what do you mean by u, can you give an example?
Walter Roberson
el 7 de Sept. de 2018
What is the mathematics behind 1 being present at the beginning of the sequence? The rest is easy to state mathematically in terms of the pochhammer symbol, but the 1 does not appear to fit.
PJS KUMAR
el 7 de Sept. de 2018
Walter Roberson
el 7 de Sept. de 2018
Does u(u-1) indicate indexing u at index u-1 or does it indicate multiplying the scalar u by (the scalar u minus 1)?
Respuesta aceptada
Más respuestas (1)
KALYAN ACHARJYA
el 7 de Sept. de 2018
u=input('Enter the value of u (more than 1): ');
n=input('Enter the numbers of Elements required: ');
a(1)=1;
for i=2:n
a(i)=a(i-1)*(u-i+2);
end
disp(a);
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!