MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply TodayThe idea is to create a vector A whose elements depend on the previous element : **A(i+1) = 2*A(i)+1**

**2 Inputs**:

- A : The first value of the vector

- iterations : The number of iterations

**1 Output**:

- A a vector with iterations+1 elements such as the i+1 element depend on the previous element as follows :

**A(i+1) = 2*A(i)+1**

Example :

A = 1; iterations = 4;

The expected output vector has 5 elements :

A = [1 3 7 15 31]

A(2) =3 because A(2) =2*A(1)+1 = 2*1+1 = 3

A(3) = 7 because A(3) =2*A(2)+1 ...

124 correct solutions
74 incorrect solutions

Last solution submitted on Oct 12, 2015

1 player likes this problem

1 Comment