Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions