How to create a sequence
256 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I am trying to create a sequence of values, where the nth term is 1/(3n+2). so if I want 10 values, the desired output would be [1/2 1/5 1/8 1/11 and so on until 1/20]. I need to use this vector for my nest function,.
0 Kommentare
Antworten (1)
David Hill
am 12 Sep. 2019
n=1:10;
x=1/(3*n+2);
You just make a vector n (1:10) and plug it into the equation (x is your desired vector).
3 Kommentare
John D'Errico
am 31 Aug. 2022
@Chris - But then if you want EXACTLY 10 terms starting at 1/2, it would be
n = 0:9;
0:10 would create 11 terms.
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!