Question: Notes: Do not hard code any of the answers for this problem. You cannot use iteration for any of the parts of this problem. vec

Notes:

Do not hard code any of the answers for this problem.

You cannot use iteration for any of the parts of this problem.

vec = [4 5 2 8 4 7 2 64 2 57 2 45 7 43 2 5 7 3 3 6523 3 4 3 0 -65 -343];

a. Create a new vector, vecA, that is the same as the vector vec except that all of the 2s have been deleted.

b. Create a new vector, vecR, that is the reverse of vec.

c. Create a new vector, vecB, that swaps the first and second halves of vec, so vecB will contain the second half of vec followed by the first half of vec.

d. Create a new vector, vecS, that contains all of the elements in vec that are smaller than 45. The numbers should be in the same order as they were in vec.

e. Create a new vector, vecT, that contains true wherever vec is greater than 10 and false everywhere else.

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!