How to create a vector with a sequence 1, u, u(u-1), u(u-1)(u-2)....
Show older comments
How to create a vector with a sequence 1, u, u(u-1), u(u-1)(u-2)....
5 Comments
Rik
on 7 Sep 2018
What have you tried so far, and what do you mean by u, can you give an example?
Walter Roberson
on 7 Sep 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
on 7 Sep 2018
Walter Roberson
on 7 Sep 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)?
Accepted Answer
More Answers (1)
KALYAN ACHARJYA
on 7 Sep 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);
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!