MATLAB Answers

Jack Kim
0

How to create a sequence

Asked by Jack Kim
on 12 Sep 2019
Latest activity Commented on by David Hill on 12 Sep 2019
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 Comments

Sign in to comment.

1 Answer

Answer by David Hill on 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).

  1 Comment

David Hill on 12 Sep 2019
x=1./(3*n+2);
forgot the dot!

Sign in to comment.