Question: Given two numerical row vectors v1, and numerical column vector v2. v1 and v2 have same lengths but unknown. Their length are more than 50.

Given two numerical row vectors v1, and numerical column vector v2. v1 and v2 have same lengths but unknown. Their length are more than 50.

1. Code to remove the first five and last 5 elements of v2. Require one line of code.
2. Code to find the difference between maximum and minimum values in the vector v2. Require one line of code.
3. Code to add 999 as the 10th element of v2. Require one line of code
4. Code to update the even location elements of vector v1 by the odd location elements. Require one line of code.
xample, v1 = [3,5,7,1, 4, 6], the even location elements are: 5, 1, 6; odd location elements are 3, 7, 4. 
Then 5, 1, 6 will be replaced by 3, 7, 4. Hence v1 will be updated to [3, 3, 7, 7, 4, 4].
5. Create a matrix A using v1 and v2. elements of v1 will be at the first row, elements of v2 will be at 2nd row. Require one line of code.

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 Databases Questions!