Consider the sequence 3 17 1.2 12 Defined by X; = 1,xp -- }(2-3 + 2) so ) i = X1 for i = 2,3,4,..., N Xi-1 The sequence
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Consider the sequence 3 17 1.2 12 Defined by X; = 1,xp -- }(2-3 + 2) so ) i = X1 for i = 2,3,4,..., N Xi-1 The sequence
Consider the sequence 3 17 1.2 12 Defined by X; = 1,xp -- }(2-3 + 2) so ) i = X1 for i = 2,3,4,..., N Xi-1 The sequence converges on V2 as N increase. Code has already been provided to define a function named SeqToSqrt2 that accepts a signal input variable N that will be an integer. Add commands to the function to do the following and assign the results to the indicated output variables names. 1. Generate a row vector containing the first N terms of the sequence and assign to the variables terms 2- Generate a scalar variable that is the relative error, e between the last term in the sequences and V2 given by the formula below (the vertical bars indicate an absolute value). Assign this error result to the variable relError: 12-yl V2 Your solution to this problem should use a for loop Not the value of the variable N (StdID) is defined as an input to the function. Do not overwrite this value in your code. Be sure to assign a value of the output variables. e =
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!