Question: Assign the vector (2, 8, 3, 7, 4, 1, 9) to an object. Using one single command, find the elements of the vector that are

Assign the vector (2, 8, 3, 7, 4, 1, 9) to an object. Using one single command, find the elements of the vector that are even or greater than 7, multiply those elements by 1 and use them to replace the original elements. Print out the new vector. (Hint: You may find the %% operator useful. Explore it using the command ?"%%".)

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!