Question: Can someone use simple codes ...please help in Matlab.only w/ problem 1 Lab Work 1. (8 points) Write a MATLAB script to solve this problem.

Can someone use simple codes ...please help in Matlab.only w/ problem 1

Lab Work 1. (8 points) Write a MATLAB script to solve this problem. Do not hard code any of the answers for this problem. You cannot use iteration for any of the parts of this problem. Dene a vector: Vec= [4528472642572457432573365233430-65-343]; a. Create a new vector, vecF, that contains the indices of every element in vec that is equal to 2. b. Create a new vector, vecA, that is the same as the vector vec except that all of the 25 have been deleted. Create a new vector, vecR, that is the reverse of vec. d. Create a new vector, vecB, that swaps the rst and second halves of vec, so vecB will contain the second half of vec followed by the first half of vec. e. Create a new vector, vecS, that contains all of the elements in the vec that are smaller than 45. The numbers should be in the same order as they were in vec. f. Create a new vector, vecT, that contains true wherever vec is greater than 10 and false everywhere else 3. Create a new vector, vec2 , that contains every other element of vec starting with the second element. h. Create a new vector, vec3R, that contains every third element of vec starting from the last element and going toward the first element in vec. F 2. (5 points} Write a MATLAB program that will compute an approximation of the infinite series: I l 2 . An approximation of an infinite series uses N terms instead of infinity. H (2n +1)(2n + 2) Test your program for N = 50; Le. compute the sum for n = 0, 1, 2, 50. The innite series converges to 111(2) . Add statements to your program to compute the 96 error of the N- term approximation to the value the series converges to. series vaIue true value % error = x 100 true value Your program should display the number of terms in N, the value of the series approximation, and for the last part, the percent error. Do not use iteration for this problem. Instead use element by element operations on arrays and the MATLAB sum function. MATLAB's built in natural log function is named log

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!